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

better message when people import fake built-ins? #190

Closed
ryanflorence opened this issue May 28, 2021 · 0 comments
Closed

better message when people import fake built-ins? #190

ryanflorence opened this issue May 28, 2021 · 0 comments

Comments

@ryanflorence
Copy link
Member

If you npm add crypto you get a build error no matter what:

> remix build

Building Remix app in production mode...
 > node_modules/@remix-run/node/sessions/fileStorage.js:6:21: error: Could not resolve "crypto" (use "platform: 'node'" when building for node)
    6 │ var crypto = require('crypto');
      ╵                      ~~~~~~~~

 > node_modules/cookie-signature/index.js:5:21: error: Could not resolve "crypto" (use "platform: 'node'" when building for node)
    5 │ var crypto = require('crypto');

I'm not sure why our compiler blows up on this (haven't dug in yet) but I know we look at the app deps and ignore built-ins, but maybe we ought to just not allow using any node modules w/ the same name as a built-in node module?

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

No branches or pull requests

2 participants