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.

v2.3.0-beta build is not esm compliant

See original GitHub issue

In the new v2.3.0-beta build, outExtension was overridden with the build format: https://github.com/timolins/react-hot-toast/blob/39c1bdac9ff3d8e17c2e65288717cf4fcb19a501/tsup.config.ts#L9-L13

This is not compliant with esm. tsup emits with the .mjs extension by default because packages with "type": "commonjs" (all packages implicitly have this) must use the .mjs extension for esm files according to Node’s resolution. Bundlers may be more forgiving.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
sachinrajacommented, Jul 9, 2022

Yes that’s mostly right! But if you’re using the "types" field in "exports" it needs to come first (see TS docs). Also the top level "module" field should be removed, it’s a nonstandard one so it could break with the mjs extension.

0reactions
sachinrajacommented, Jul 9, 2022

Thanks @timolins! The new release looks good

Read more comments on GitHub >

github_iconTop Results From Across the Web

ESM only breaks everything · Issue #1263 · node-fetch/node ...
We spend lots of work trying to be spec compliant and fetch isn't a small piece, it involves many web-components. ESM is one...
Read more >
Gatsby Changelog | 5.3.0
The Non-ESM browsers are not polyfilled by default change speeds up the "Building production JavaScript and CSS bundles" step dramatically since webpack doesn't ......
Read more >
Tweets with replies by Rollup (@RollupJS) / Twitter
with v2.3.0: - use unprocessed ESM configs in Node 13 via the .mjs extension, i.e. rollup.config.mjs - use unprocessed CJS configs in all...
Read more >
What does it take to support Node.js ESM? – The Guild
To add support ESM for Node.js, you have two alternatives: build your library into ESM Compatible modules with the extension .mjs , and...
Read more >
require() of es module is not supported - You.com - You.com
The current version of node-fetch is ONLY compatible with an ESM import (using import ), not from CommonJS modules using require() .
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