-
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(component-testing): Fix webpack-dev-server deps validation crash #15708
Conversation
Thanks for taking the time to open a PR!
|
Test summaryRun details
View run in Cypress Dashboard ➡️ Flakiness
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 |
avoid importing package.json so that it is not analyzed
I decided to delete this test that using NEXT_DATA global because it is diving too deep into next's internal implementation. Originally testing components with router usage should be a bad practice, but using more and more internal APIs is even worse because this test will fail for literally all users between next's releases |
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 have 2 non blocking comments.
LGTM
This fixes issue https://cypress-io.atlassian.net/browse/CT-391
Actually, there was a small problem related to next v10 that was fixed here, but the weird error is coming from webpack-dev-server peer dependencies validation which was crashing this installation.
I cleaned it up a little bit to 1) make sure that we always use real peer dependencies 2) reduce the amount of code and add better types. But I doubt that we need this, nodejs will throw an explicit error if dependencies are missing but we are running this validation on each start for each run on CI and as far I know (not 100% sure)
require
undertry { } catch
will always be deoptimized and won't be cached and overall [require](https://kevin.burke.dev/kevin/node-require-is-dog-slow] is a really slow operation. So maybe we can delete this validation? What do you think @JessicaSachs