-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
Bug report
Describe the bug
After upgrading to next@9.5.2, client bundle includes browser polyfils for Node.js, probably related to #16022.
As far as I can tell, no code relies on these modules, because doing
delete config.resolve.alias.crypto;
delete config.resolve.alias.stream;
delete config.resolve.alias.path;
delete config.resolve.alias.buffer;
delete config.resolve.alias.vm;in next.config.js removes the modules from the bundle, but the code still works.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
- Upgrade to next 9.5.2
- Bundle your code
- Inspect the output
I realise that this will not be easy to debug, since it probably is related to our setup, which is closed source (sorry).
Expected behavior
Unnecessary browser node polyfills should not be in the bundle
Screenshots
System information
- OS:macOS
- Version of Next.js: 9.5.2
- Version of Node.js: 12.18.3
Additional context
My best guess is that some code only running on the server causes this to be bundled, even though it is not used on the client.
Any help with further debugging would be awesome, just knowing why these are ending up being a part of the bundle. What dependency triggers these to be bundled.
