-
Notifications
You must be signed in to change notification settings - Fork 27.5k
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
Add a require hook for webpack backwards compatibility #21789
Comments
I was about to submit an issue reporting that worker-loader no longer works with webpack 5. This is the bug repro in case that you want to check https://github.com/ramasilveyra/bug-repro-next-w5-inline-worker but it seems that my draft issue is a duplication of this |
FYI some things that I found while trying to make worker-loader work:
|
This implements the compatibility require hook as per #21789. The hook is applied at the point of webpack initialization. In addition the separate packages are exposed for the various webpack subrequires. The test then ensures instance equality for the basic require hook from the next.js config file. I suspect this might have bad interactions with Yarn Pnp support, but maybe we will be lucky.
Closing as this was landed in #21802 |
FYI worker-loader is still broken, created ticket #21972. |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Next.js no longer ships with the
webpack
dependency, however, lots of plugins (improperly) requirewebpack
without a peer dependency setup. To prevent them from breaking, we need to inject a require hook to intercept this request and vendor Next.js' built-in version.The text was updated successfully, but these errors were encountered: