You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
internal/modules/cjs/loader.js:885
const err = new Error(message);
^
Error: Cannot find module 'node:fs'
Require stack:
- /Users/sinedied/projects/publish-devto/dist/index.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:885:15)
...
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:
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: