v2.3.0-beta build is not esm compliant
See original GitHub issueIn 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:
- Created a year ago
- Comments:5 (2 by maintainers)
Top 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 >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 FreeTop 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
Top GitHub Comments
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.Thanks @timolins! The new release looks good