-
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(webpack-preprocessor): cleanseError compatability with error objects #14330
Conversation
Thanks for taking the time to open a PR!
|
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.
@iFaxity Could you write a test for this change? We have some unit and e2e tests in this plugin you can run by running yarn test
in this package.
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.
Done! Also added webpack ^5.0.0 to peerDependencies so npm v7 doesn't error out when trying to install the package.
Dismissing my review for technical review.
@dmtrKovalenko had previously looked into Webpack 5 support, not sure if this addresses everything in #8900 so will let him followup with review. |
The problem of this concrete PR is that it's not really use webpack v5 to run the tests. (lock file not updated) We already have a #8929 pr for these changes that probably can already be revisited, I'll take care on it, that implements all the required fixes for webpack v5. |
@dmtrKovalenko Yes, missed that pull request, the same fix is implemented in the commit d2d95b2, closing this. |
@iFaxity thank you for your work! 🙏 |
User facing changelog
Using @cypress/webpack-preprocessor with webpack v5 causes plugin to crash when error is outputted as an Error object instead of the expected string.
Additional details
This fixes an error in which errors outputted by webpack v5 are not strings but Error objects. This prevents any kind of error message being shown to the user, instead outputting an error from the webpack-preprocessor package.
How has the user experience changed?
This results in the error message changing from this:
To the more interesting and helpful:
PR Tasks
No tasks applicable.