KEMBAR78
After upgrading to to 9.5.2, client bundle includes unnecessary browser-node-polyfills · Issue #16259 · vercel/next.js · GitHub
Skip to content

After upgrading to to 9.5.2, client bundle includes unnecessary browser-node-polyfills #16259

@tbergquist-godaddy

Description

@tbergquist-godaddy

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:

  1. Upgrade to next 9.5.2
  2. Bundle your code
  3. 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

Screenshot 2020-08-17 at 14 59 16

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions