remix icon indicating copy to clipboard operation
remix copied to clipboard

`remix dev` fails when workspace has a deprecated node-builtin in unrelated package

Open SlexAxton opened this issue 2 months ago • 0 comments

Reproduction

https://github.com/SlexAxton/remix-dev-node-shadow-bug-repro

System Info

System:
    OS: macOS 14.3
    CPU: (10) arm64 Apple M1 Max
    Memory: 30.95 GB / 64.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.12.2 - ~/.nodenv/versions/20.12.2/bin/node
    npm: 10.5.0 - ~/.nodenv/versions/20.12.2/bin/npm
    pnpm: 9.0.6 - ~/.proto/shims/pnpm
  Browsers:
    Chrome: 124.0.6367.92
    Safari: 17.3

Used Package Manager

pnpm

Expected Behavior

I'd expect remix not to care that a different package has installed a crypto module.

Actual Behavior

Remix dev mode fails to run:

❯ pnpm run -r remix-app-dev
Scope: 2 of 3 workspace projects
packages/remix-app dev$ remix vite:dev
[23 lines collapsed]
│     at Object.buildOrContext (/Users/alex/code/vite-dev-node-shadow-repro/node_modules/.pnpm/es…
│     at /Users/alex/code/vite-dev-node-shadow-repro/node_modules/.pnpm/[email protected]/node_modul…
│     at new Promise (<anonymous>)
│     at Object.context (/Users/alex/code/vite-dev-node-shadow-repro/node_modules/.pnpm/esbuild@0…
│     at Object.context (/Users/alex/code/vite-dev-node-shadow-repro/node_modules/.pnpm/esbuild@0…
│     at prepareEsbuildOptimizerRun (file:///Users/alex/code/vite-dev-node-shadow-repro/node_modu…
│   The plugin "vite:dep-pre-bundle" was triggered by this import
│     ../../node_modules/.pnpm/[email protected]/node_modules/cookie-signature/index.js:5:21:
│       5 │ var crypto = require('crypto');
│         ╵                      ~~~~~~~~
└─ Running...

More info on reproduction in the repro repo.

SlexAxton avatar Apr 30 '24 17:04 SlexAxton