Skip to content
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

Types are not correct for native ESM modules and cannot be imported there #237

Closed
spence-s opened this issue Oct 1, 2023 · 3 comments
Closed

Comments

@spence-s
Copy link

spence-s commented Oct 1, 2023

https://arethetypeswrong.github.io/?p=eslint-define-config%401.23.0

It is impossible to import types correctly into a node.js project using

"module": "node16",
"moduleResolution": "node16",

v1.20 is the last version that worked correctly

@spence-s
Copy link
Author

I believe you just need to update the module in this tsconfig to Node16, I am happy to contribute this fix if it would be accepted. I think it would still work in the same way it does now, except it will also work in native node ESM environments where it does not now.

@Shinigami92
Copy link
Collaborator

Shinigami92 commented Oct 11, 2023

Please check v1.24.1
Since v1.24 we switched from no process step to tsup bundle
So the dist content is now newly organized

If this still happens please create a minimal reproduction that we can checkout to see the error

@spence-s
Copy link
Author

spence-s commented Oct 11, 2023

Yes this release has fixed the issue for me and you can see that it now passes more checks here:

https://arethetypeswrong.github.io/?p=eslint-define-config%401.24.1

The website linked is maintained by TS or a core TS maintainer, and has been really helpful for me to understand the complex modules system and fix inconsistencies.

https://github.com/arethetypeswrong/arethetypeswrong.github.io/tree/main/packages/cli

Thanks for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants