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.

Support Native ESM

See original GitHub issue
  • Well aware of note in readme

Due to how ESM loader is used in this library , redefines require, I can’t treat the library as CJS and just import the default and go from there.

Tried to just import directly from src/module.js, but then it throws the error about loading ES modules. The old “type”:“module” in package.json which was expected but had to try.

This is a nice to have. Just wanted to ask since I’ll have to wrap my project in the ESM loader again. Again, nbd, thanks for the lbirary!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
PaulSearcycommented, Aug 17, 2021

@arackaf I know regex https://xkcd.com/208/ 😄

1reaction
arackafcommented, Aug 17, 2021

@PaulSearcy getting this to work with native esm will be a TON of work. Lots and lots and lots of imports will need file extensions added, and I think I’m grabbing some stuff out of node_modules - which may cause this original issue.

I’ll happily accept a PR that makes this work with native esm, I just fear this may be harder than you realize 😐

Read more comments on GitHub >

github_iconTop Results From Across the Web

"ESM" | Can I use... Support tables for HTML5, CSS3, etc
"Can I use" provides up-to-date browser support tables for support of front-end web technologies on desktop and mobile web browsers.
Read more >
Native ES Modules in Node.js - CodinGame
With the native ESM support in browser, it seems now essential to have it in Node.js . From its beginning, Node.js uses a...
Read more >
JavaScript modules - MDN Web Docs
Use of native JavaScript modules is dependent on the import and export statements; these are supported in browsers as shown in the ...
Read more >
What does it take to support Node.js ESM? – The Guild
This post is intended to work as a guide to support both CommonJS and ESM and will be updated accordingly in the future...
Read more >
ECMAScript modules | Node.js v19.3.0 Documentation
Node.js fully supports ECMAScript modules as they are currently specified and ... Caveat: The ESM load hook and namespaced exports from CommonJS modules...
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