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

Failed to resolve the module node:* #989

Closed
ahmadnassri opened this issue Aug 11, 2022 · 5 comments
Closed

Failed to resolve the module node:* #989

ahmadnassri opened this issue Aug 11, 2022 · 5 comments

Comments

@ahmadnassri
Copy link

node core modules can imported with node: prefix, e.g. require('node:fs') don't seem to work.

image

@rschristian
Copy link
Collaborator

rschristian commented Aug 11, 2022

Just a warning, and already resolved by #956. Just hasn't been released yet.

@rschristian
Copy link
Collaborator

Just release 0.15.1 so this should be corrected.

Thanks

@ahmadnassri
Copy link
Author

Thank you @rschristian

@donmccurdy
Copy link
Contributor

I'm compiling a library that runs in both Node.js and a browser, and the library contains dynamic imports for node built-ins like 'fs', executed only in Node.js. The target for Microbundle is not necessarily Node.js.

When importing fs I can add the following to my package.json and everything works fine:

"browser": {
  "fs": false,
  "path": false
},

However, using node:fs, the same thing does not work, and warnings continue to appear with:

"browser": {
  "node:fs": false,
  "node:path": false
},

Is this intended, and (if not) should I file a separate issue for it?

@rschristian
Copy link
Collaborator

@donmccurdy Separate issue please, if you can

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

3 participants