-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(npm/webpack-preprocessor): release npm/webpack-preprocessor 4.8.0 #16504
Conversation
…ck 4 (#16493) * feat: support webpack 5 alongside webpack 5 * revert code
Thanks for taking the time to open a PR!
|
Test summaryRun details
View run in Cypress Dashboard ➡️ This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
Eagerly awaiting this release! |
@ntucker this will be live in a few hours (waiting semantic release to run on CI right now). If you are using webpack 5, you will still need to deal with the various deprecations, summaized here, mainly around no nodejs module polyfills. Once the release is done, please give this a try and let me know if you have any problems still - it was difficult to fully test since all the big apps I have (Cypress monorepo, personal ones) are non trivial to migrate to webpack 5. It worked fine on the small apps I tested with, though. |
I'm using it with a custom webpack config (that handles things like node polyfills, among others) but still getting invalid config object with a temp package release. |
Can you please share a reproduction (or if you can't, your webpack config)? It worked for the examples we have. Alternatively, you could join our discord and we can talk in real time, or pair. I really want to get webpack 5 stable. |
I'm getting
What version of the CLI is expected? Using https://github.com/ntucker/anansi/tree/master/packages/webpack-config-anansi mostly for the config. (you can setup a project quickly with Joined the discord, but didn't find the same username there. Mine is the same there. |
https://github.com/cypress-io/cypress/blob/master/npm/webpack-preprocessor/package.json still has webpack 4 as peerdep - is this right? |
I can find debug statements like https://github.com/cypress-io/cypress/blob/master/npm/webpack-preprocessor/index.ts#L220 but how do I activate them? The cli doesn't seem to have an option to enable debug logging |
@lmiller1990 I just edited the node_modules paths directtly. Turns out we're using the function form of webpack config https://webpack.js.org/configuration/configuration-types/#exporting-a-function |
I have defineplugin...how do i track down there this is? |
@lmiller1990 so are there plans to not use node-only modules, or release a webpack 5 plugin that makes process work? Got no response in the discord either. |
For others following along: this is how webpack 4 polyfilled node's process variable: https://v4.webpack.js.org/configuration/node/ This is no longer covered. |
How to test webpack 5 base compatibility: https://webpack.js.org/migrate/5/#test-webpack-5-compatibility |
Is there an alternative to @cypress/snapshot that works with webpack5? |
@ntucker I have not tested @cypress/snapshot with webpack 5, but I can look into this. What is happening when you try using it? For webpack 5, I tested it out in a (very simple) project and it worked for me: https://github.com/lmiller1990/cypress-react-webpack-5-example. I can't say for a more complex configuration, but if you have one you can share, happy to take a look and the necessary changes to Cypress to fully support webpack 5. |
Process is not defined in variable-diff package. I pasted the stack trace above |
@cypress/snapshot relies on |
@lmiller1990 if you don't trigger a codepath that does something interesting at all of course you won't trigger the chalk code to run and thus not get the problem |
@lmiller1990 you need @cypress/snapshot to repro |
Right, I understand. Short term: use a polyfill like described here. That would be I'm not sure how we should best approach this long term. The offending line is ultimately here in the |
@lmiller1990 Ah yes, thanks! I was looking for a plugin like that and for some reason couldn't find it - so much appreciated there. Also thanks for bringing up the issue with the dependency. 👍 |
New minor version release.Eexperimental-ish Webpack 5 support (well, not experimental. It works, but users need to polyfill node APIs).
I cherry-picked the commit from the branch that was merged into develop.