@cypress/webpack-dev-server is incompatible with webpack-dev-server ^4
See original GitHub issueCurrent behavior
webpack-dev-server introduced breaking changes to their configuration object in their beta version. Cypress component tests fail when running with “webpack-dev-server”: “^4.0.0-beta.2”,
I know that this is beta, but my team is using this to be able to serve our web app via encore
for development. We need to have this installed at ^4 as a dev dependency
The following error is thrown:
WARNING The value passed to setManifestKeyPrefix "/dist" starts with "/". This is allowed, but since the key prefix does not normally start with a "/", you may have just changed the prefix accidentally.
Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema.
- configuration has an unknown property 'noInfo'. These properties are valid:
object { bonjour?, client?, compress?, dev?, firewall?, headers?, historyApiFallback?, host?, hot?, http2?, https?, liveReload?, onAfterSetupMiddleware?, onBeforeSetupMiddleware?, onListening?, open?, port?, proxy?, public?, setupExitSignals?, static?, transportMode?, watchFiles? }
ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema.
- configuration has an unknown property 'noInfo'. These properties are valid:
object { bonjour?, client?, compress?, dev?, firewall?, headers?, historyApiFallback?, host?, hot?, http2?, https?, liveReload?, onAfterSetupMiddleware?, onBeforeSetupMiddleware?, onListening?, open?, port?, proxy?, public?, setupExitSignals?, static?, transportMode?, watchFiles? }
at validate (/Users/morgan/Documents/WineSpectator/git/ws/node_modules/webpack-dev-server/node_modules/schema-utils/dist/validate.js:104:11)
at new Server (/Users/morgan/Documents/WineSpectator/git/ws/node_modules/webpack-dev-server/lib/Server.js:43:5)
at Object.<anonymous> (/Users/morgan/Documents/WineSpectator/git/ws/node_modules/@cypress/webpack-dev-server/dist/startServer.js:57:16)
at Generator.next (<anonymous>)
at fulfilled (/Users/morgan/Documents/WineSpectator/git/ws/node_modules/@cypress/webpack-dev-server/dist/startServer.js:5:58)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
Looks like this stems from line 55 in startserver.js
const webpackDevServerConfig = Object.assign(Object.assign({}, userWebpackConfig.devServer), { hot: false, inline: false, publicPath: devServerPublicPathRoute, noInfo: false });
// @ts-ignore types for webpack v5 are incorrect?
return new webpack_dev_server_1.default(compiler, webpackDevServerConfig);
This is passing config options that are no longer supported/have moved
Desired behavior
We’d love to be able to run cypress component tests alongside webpack-dev-server ^4
I’m frustrated that the symfony team is requiring a beta version for their dev server to work with encore, and understand that it may be a stretch to support a beta version of webpack-dev-server, but this may be indicative of impending breaking changes at some point anyways.
Test code to reproduce
npm i -D webpack-dev-server@next
npx cypress run-ct
Versions
“@cypress/react”: “^5.4.2” “@cypress/webpack-dev-server”: “^1.1.6” “@symfony/webpack-encore”: “^1.1.2” “cypress”: “7.2.0” “webpack-dev-server”: “^4.0.0-beta.2”
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:10 (6 by maintainers)
Top GitHub Comments
While we discuss the above, I was able to implement basic support for WDS v4 with minimal code changes here: https://github.com/cypress-io/cypress/pull/16414
I think so. We have basic support as of #16414. Let’s keep an eye on WDS v4 as it moves to a stable release.