Skip to content
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

Closed
Timer opened this issue Feb 2, 2021 · 5 comments
Closed

Add a require hook for webpack backwards compatibility #21789

Timer opened this issue Feb 2, 2021 · 5 comments
Milestone

Comments

@Timer
Copy link
Member

Timer commented Feb 2, 2021

Next.js no longer ships with the webpack dependency, however, lots of plugins (improperly) require webpack 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.

@ramasilveyra
Copy link
Contributor

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

@ramasilveyra
Copy link
Contributor

FYI some things that I found while trying to make worker-loader work:

elmasse added a commit to elmasse/elmasse.io that referenced this issue Feb 3, 2021
kodiakhq bot pushed a commit that referenced this issue Feb 4, 2021
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.
@ijjk
Copy link
Member

ijjk commented Feb 8, 2021

Closing as this was landed in #21802

@ijjk ijjk closed this as completed Feb 8, 2021
@ramasilveyra
Copy link
Contributor

FYI worker-loader is still broken, created ticket #21972.

@balazsorban44
Copy link
Member

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.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants