-
Notifications
You must be signed in to change notification settings - Fork 288
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
Issue with ESM and node:protocol #789
Labels
bug
Something isn't working
Comments
I was able to reproduce with a
Seems like webpack is incorrectly turning the import into require() |
Looks like webpack always emits CJS for Looks like it needs Node.js 16 or newer. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm working on a Node.js project using ESM modules, and after bundling with ncc I have errors with imports using the
node:
protocol:Tracing back the error, it seems that it's due to these generated imports:
__WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:fs")
It seems that node imports using this protocol leads to incorrect import generation. If I do a search & replace to remove the
node:
prefix from the output, the code works fine though.Note that I have no way to alter these
node:
imports as they come from dependencies.Did I missed something or it an issue with ncc?
The text was updated successfully, but these errors were encountered: