question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created a year ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
rbucktoncommented, Sep 6, 2022

This should be fixed in 1.0.0-pre.34

0reactions
rbucktoncommented, Sep 7, 2022

Alright, I’ve published -pre.37 which should have the missing package.json stubs and disables native hash code generation for now.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found