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

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

Open
SlexAxton opened this issue Apr 30, 2024 · 0 comments

Comments

@SlexAxton
Copy link

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/esbuild@0.20.2/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/cookie-signature@1.2.1/node_modules/cookie-signature/index.js:5:21:
│       5 │ var crypto = require('crypto');
│         ╵                      ~~~~~~~~
└─ Running...

More info on reproduction in the repro repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants