-
Notifications
You must be signed in to change notification settings - Fork 136
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 5 wrapper handling #186
Conversation
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.
Thanks!
Codecov Report
@@ Coverage Diff @@
## master #186 +/- ##
==========================================
+ Coverage 80.18% 80.31% +0.12%
==========================================
Files 13 13
Lines 1383 1392 +9
Branches 529 531 +2
==========================================
+ Hits 1109 1118 +9
Misses 107 107
Partials 167 167
Continue to review full report at Codecov.
|
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.
It looks like this still fails using the repo here https://github.com/sozonome/nextjs-webpack5-api-route-vercel-deployment-error and tracing .next/server/pages/api/posts.js
after yarn build
The module cache/bootstrap code is also moved to a separate file in webpack 5 webpack-runtime.js
, could this be causing a conflict here?
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.
Awesome, looks like it's catching it now! 🎉 🎉
Fixes #185 adding support for the new Webpack 5 namespace form which is a function not an object with an
a
property. The fix supports both webpack 4 and webpack 5 in an indirect way by creating the wrapperObject.assign(() => require('x'), { a: require('x') })
, with the expression entirely evaluated virtually within the static evaluation system as a way to inform the evaluation result.