question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

@cypress/webpack-dev-server is incompatible with webpack-dev-server ^4

See original GitHub issue

Current 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:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
lmiller1990commented, May 10, 2021

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

0reactions
lmiller1990commented, May 31, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

@cypress/webpack-dev-server - npm
Launches Webpack Dev Server for Component Testing. Latest version: 3.2.0, last published: 8 days ago.
Read more >
Webpack build failing with ERR_OSSL_EVP_UNSUPPORTED
I was able to fix it via: export NODE_OPTIONS=--openssl-legacy-provider. sachaw's comment to Node.js v17.0.0 - Error starting project in ...
Read more >
To v5 from v4 - webpack
This guide aims to help you migrating to webpack 5 when using webpack directly. If you are using a higher level tool to...
Read more >
Did you get hit with the "Node 17 digital envelope routines
Bug report **What is the current behavior?** ```sh [webpack-c…li] Error: error:0308010C:digital envelope routines::unsupported at new Hash ...
Read more >
Changelog - Cypress Documentation
Angular component testing projects can provide a custom configuration to the Webpack dev server using the projectConfig key. This enables support for ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found