Skip to content

Node builtin polyfills not tree shaking correctly #7134

@ABuffSeagull

Description

@ABuffSeagull

What version of Remix are you using?

1.19.3

Are all your remix dependencies & dev-dependencies using the same version?

  • Yes

Steps to Reproduce

Check this repo: https://github.com/ABuffSeagull/remix-node-tree-shake-bug
It's just importing 2 builtin modules: node:assert/strict and node:process. node:assert/strict is used directly in the loader, while node:process is exported from another file (notably not a .server.ts file).
This happens with basically every node builtin, with and without the node: prefix, as far as I can tell.

Expected Behavior

Both node:assert/strict and node:process should be completely eliminated from the browser bundles.

Actual Behavior

Only node:process is eliminated from the browser bundle. node:assert/strict is still being polyfilled.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions