-
Notifications
You must be signed in to change notification settings - Fork 57
Not valid ESM typings #383
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
Comments
I've just made a fix in my fork: esm-js@8934d33 ![]() You've made a change in package.json with |
Hey @Arilas! Can you give an example of when this failed? A playground demo would be ideal |
@MrRefactoring The easiest way is to:
import { Version3Client } from 'jira.js'
You can also check the docs about ESM in TypeScript - https://www.typescriptlang.org/tsconfig/#node16node18nodenext |
@MrRefactoring I've made a very simple demo repository. https://github.com/Arilas/jira-bug-example You can clone and see the error in IDE or run tsc |
Btw, neighbour issue is related to a type: module in your package.json. It thinks that your package is ESM even when trying to load CommonJS bundle. My fix will also will fix this issue, because you will have a separate entries into package for ESM and CommonJS. |
@Arilas, could you please test the npm i jira.js@5.1.1-dev20250506193213 |
FWIW, I ran across this same issue when I tried out version 5.0.0. The |
Uh oh!
There was an error while loading. Please reload this page.
Your package has single "types" entry in your package.json, you should have something like:
Also, your typing information is not valid ESM, because it uses relative imports without extensions, so TypeScript ignores those imports. Example of error:
The easiest fix would be to replace custom rollup config with tsup, and adding
format: ['esm', 'cjs'], dts: true
to tsup config.The text was updated successfully, but these errors were encountered: