// webpack.config.js
// Here is a minimal config that fails
{
target: 'web',
mode: IS_DEV ? 'development' : 'production',
context: path.resolve('./src'),
resolve: {
extensions: ['.js', '.ts', '.tsx']
}
}
webpack-dev-server should be able to work with webpack 5.
I am running [email protected] and [email protected] alongside [email protected].
Simply running the $ yarn webpack-dev-server command is launching the server correctly, but as soon as I pass it our actual config file with $ yarn webpack-dev-server --config <path-to-config>.js, it is failing with the following error:
/node_modules/webpack-cli/bin/utils/convert-argv.js:140
if (webpackConfigurationValidationErrors.length) {
^
TypeError: Cannot read property 'length' of undefined
at processConfiguredOptions (/node_modules/webpack-cli/bin/utils/convert-argv.js:140:44)
at module.exports (/node_modules/webpack-cli/bin/utils/convert-argv.js:131:10)
at Object.<anonymous> (/node_modules/webpack-dev-server/bin/webpack-dev-server.js:84:40)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Function.Module.runMain (module.js:694:10)
at startup (bootstrap_node.js:204:16)
I tried removing most of the config, but it seems to fail as soon as a config file is passed.
Starting [email protected] with [email protected] and [email protected] with the --config flag.
Adding long-term support for webpack 5 to benefit from its major updates.
We need setup webpack@5 in CI to ensure all works fine, i think only cli broken
+1
Indeed, this is now resolved using [email protected] with [email protected].
Thanks @evilebottnawi
Keep open until we set up CI
webpack-cli/bin/ no longer exists as of (https://github.com/webpack/webpack-cli/commit/82407e5e1fee2ce7e8dd4cfa9596b99ed0cde4fc). This is a blocker for at least [email protected]. Is there a workaround...?
@JoshuaKGoldberg we try to solve this for next release
im getting..
warning " > [email protected]" has incorrect peer dependency "webpack@^4.0.0".
guessing its down to this thread still being open
@jasonwilliams ignore this, we update peerDeps field after stable release
Most helpful comment
https://github.com/webpack/webpack-dev-server/blob/c9e9178a4882e414a6b9616baa35e8dbf7b2dd75/bin/webpack-dev-server.js#L61
webpack-cli/bin/no longer exists as of (https://github.com/webpack/webpack-cli/commit/82407e5e1fee2ce7e8dd4cfa9596b99ed0cde4fc). This is a blocker for at least[email protected]. Is there a workaround...?