-
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
fix: avoid nextjs unsafeCache and watchOptions #20440
fix: avoid nextjs unsafeCache and watchOptions #20440
Conversation
Thanks for taking the time to open a PR!
|
Test summaryRun details
View run in Cypress Dashboard ➡️ FlakinessThis 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Any perf implication?
- CI is failing hardcore - did this cause that?
- Gonna need to add a test for this somehow - it's not even clear how to test by hand, but we definitely need some kind of automated testing here.
As for the actual implementation, cool hack, no idea if there's a better/cleaner way (likely, but I don't know what it is).
@BlueWinds is working around webpack lately, they may be interested to see this PR/issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there is any good way to test this. We could probably write a unit test where we spin up a dev-server with a Next webpack config, touch a file and assert that webpack recompiles but we would need to have Next v12 installed. I would take note of this since our testing is lacking in this area
@@ -41,6 +41,15 @@ async function getNextWebpackConfig (config) { | |||
|
|||
checkSWC(nextWebpackConfig, config) | |||
|
|||
if (nextWebpackConfig.watchOptions && Array.isArray(nextWebpackConfig.watchOptions?.ignored)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to remove the optional chaining as this will fail on node v12
In webpack 5 it seems that loaders called with the exact same query are not re-run.
This creates a situation where the Cypress file watcher is updating the files but the new files are never pushed in the loader. It results in Cypress throwing a (No tests found) error since the spec exists but not in the AUT.
In this PR I disable caching and unsafe caching for the browser.js file.