Latest version does not include ES module entry points
See original GitHub issue$ cat package.json
{
"dependencies": {
"@esfx/lazy": "1.0.0-pre.33"
}
}
$ node --input-type=commonjs -e 'require("@esfx/lazy")'
$ node --input-type=module -e 'import "@esfx/lazy"'
node:internal/process/esm_loader:97
internalBinding('errors').triggerUncaughtException(
^
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '<cwd>/node_modules/@esfx/lazy/dist/esm/index.js' imported from <cwd>/[eval1]
Did you mean to import @esfx/lazy/dist/cjs/index.js?
at new NodeError (node:internal/errors:393:5)
at finalizeResolution (node:internal/modules/esm/resolve:305:11)
at moduleResolve (node:internal/modules/esm/resolve:866:10)
at defaultResolve (node:internal/modules/esm/resolve:1074:11)
at nextResolve (node:internal/modules/esm/loader:164:28)
at ESMLoader.resolve (node:internal/modules/esm/loader:839:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:426:18)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:76:40)
at link (node:internal/modules/esm/module_job:75:36) {
code: 'ERR_MODULE_NOT_FOUND'
}
Node.js v18.8.0
Issue Analytics
- State:
- Created a year ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Support Node's ES Modules · Issue #21457 · electron ... - GitHub
Currently when trying to run electron with an ES entry point (either .mjs or .js ... Electron only includes LTS releases of Node,...
Read more >Using ES modules in Node.js - LogRocket Blog
Learn about the state of ES modules in Node today, including concerns ... it is advisable to have the latest version of Node.js...
Read more >Error [ERR_REQUIRE_ESM]: require() of ES Module ... not ...
The current version of node-fetch is ONLY compatible with an ESM import (using import ), not from CommonJS modules using require() .
Read more >ECMAScript modules | Node.js v19.3.0 Documentation
They can refer to the main entry point of a package by the package name, or a specific feature module within a package...
Read more >The JavaScript Modules Handbook – Complete Guide to ES ...
This article will show you all you need to know about ES Modules and ... Suppose you did not add your project folder...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This should be fixed in 1.0.0-pre.34
Alright, I’ve published
-pre.37
which should have the missingpackage.json
stubs and disables native hash code generation for now.