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.

CJS and ESM issue

See original GitHub issue

Using this library with SvelteKit, I received the following error message:

svelte-notifications doesn't appear to be written in CJS, but also doesn't appear to be a valid ES module (i.e. it doesn't have "type": "module" or an .mjs extension for the entry point). Please contact the package author to fix.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:6
  • Comments:15 (11 by maintainers)

github_iconTop GitHub Comments

usernamuscommented, Feb 8, 2022

Guys I’m working on this. So far I haven’t spent much time but I hope I can fix this

chbertcommented, Jan 31, 2022

Just in case it helps, same error here:

  • Mac OS X 12.1
  • “svelte-notifications”: “^0.9.93”,
  • “svelte”: “^3.46.3”,
  • @sveltejs/kit”: “next”,
Read more comments on GitHub >

github_iconTop Results From Across the Web

Relative performance of CJS vs ESM #44186 - nodejs/node
ESM and CJS classes should have similar performance characteristics instead of ESM being 10x slower than CJS.
Read more >
Node Modules at War: Why CommonJS and ES ... - Code Red
ESM and CJS are completely different animals. Superficially, ESM looks very similar to CJS, but their implementations couldn't be more different ...
Read more >
What the heck are CJS, AMD, UMD, and ESM in Javascript?
CJS executes imports as it finds them, blocking until they finish. ESM waits to execute any code in a module until all of...
Read more >
CommonJS (cjs) and Modules (esm): Import compatibility
You can import CommonJS (cjs) into ESM modules, and vice versa (esm into cjs). But one way is easier than the other.
Read more >
Publish ESM and CJS in a single package - Anthony Fu
Some packages now ship pure-ESM packages advocating the ecosystem to move from CJS to ESM. While this might be the "right thing to...
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 Post

No results found

github_iconTop Related Hashnode Post

No results found