New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ESM usage is broken in intl-messageformat@10.4.0
#4126
Comments
I have same issue like this. Please give us the solution or any hot fix for this? |
You can pin down the previous version while we investigate |
Dual publishing is hard. A lot of people underestimate the details. My general recommendations are:
|
Same issue here, had to pin to 10.3 |
Same here. Is anyone working on this? |
Can confirm, this issue happens to me as well. Switched to 10.3 |
Yeah I have to force switch back to version 10.3.5 |
+1 have to switch back to version 10.3.5 |
Wasted a bunch of hours on this for vitest config, the inline deps override did not seem to work. Downgrade to |
(node:47736) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension. The ESM module should be published as .mjs instead of .js to fix this. |
…t-parser,@formatjs/intl-displaynames,@formatjs/intl-listformat,intl-messageformat,@formatjs/ecma402-abstract,@formatjs/intl-numberformat,@formatjs/icu-skeleton-parser): Revert esm conditional exports (#4129) The ESM export chanegs are not properly tested and therefore broke in various scenarios. Fixes #4128, #4127, #4126 This reverts commit e0d593c.
Apologies for breaking your build. The ESM exports change are not properly tested and I have reverted the change. The following packages have been marked as deprecated on npm and the newer versions including the revert have been published:
We will figure out a working test strategy for ESM packages next time before we attempt it. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Which package?
intl-messageformat@10.4.0
Describe the bug
intl-messageformat@10.4.0
package imports resolve tolib/index.js
. This is a.js
file in a package that doesn’t specify"type": "module"
. This makes it CJS, but it contains ESM syntax.To Reproduce
Reproducible Steps/Repo
Steps to reproduce the behavior:
intl-messageformat@10.4.0
script.mjs
with the following content:Expected behavior
Nothing
Screenshots
No screenshot, but a stack trace:
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
The ESM files should be actual ESM. Since everything in the
lib
directory is ESM, the simplest solution would be to writelib/package.json
with the following content:Alternatively the
.mjs
extension should be used, and the.mts
extension for TypeScript files.Type definitions need to match as well. To fix this, the
"exports"
→".'
→"types"
field needs to be removed.Also ESM requires to use file extensions in the import.
The text was updated successfully, but these errors were encountered: