-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
How to publish a package that's compatible with projects using "moduleResolution": "nodenext" #53636
Comments
does this answer anything? https://arethetypeswrong.github.io/?p=antlr4%404.12.0 |
@ritschwumm no it shows node16 (from ESM) | ✅ (ESM) even though the package doesn't work with I think that illustrates that there isn't enough established guidance and knowledge how to make packages support In my issue on arethetypeswrong, they confirmed that it doesn't do full checking that would catch issues like this. |
Okay the issue is that Because
|
Should the docs recommend all pure ESM packages to use I see a lot of painful dev confusion ahead as the ecosystem moves toward pure ESM. That confusion can only be prevented through better guidance. |
That's why #52593 exists. |
I'm a little confused how this package even works at runtime if this is the case - Node itself won't even resolve ESM imports without a file extension. |
@fatcerberus it has ESM |
@MartinJohns thanks, I hadn't come across that issue, i can close this then |
Bug Report
I'm trying to use
antlr4
in a project. I have this import:If I use
"moduleResolution": "nodenext"
it says "Module '"antlr4"' has no exported member 'CommonTokenStream'."This is using TS 5.0.3.
I'd like to make a PR to
antlr4
to fix this, but I'm not sure what the correct solution is. There's no obvious best-practice package authoring guidance in the TS docs.What should be changed in
antlr4
'spackage.json
? It has"type": "module"
,"main"
and"types"
fields. It doesn't seem like the docs are of any help here except that they say"types"
is a "Fall-back for older versions of TypeScript". Does this mean"nodenext"
completely ignores"types"
and the only option would be forantlr4
to provide an export map, or what?The text was updated successfully, but these errors were encountered: