-
-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Compilation issue with TypeScript 5.2.2 #204
Comments
Could you share a reproducible link to your tsconfig and package.json? |
Hello @frangio. Please provide a minimal reproduction using a TypeScript Playground or GitHub repository. Issues marked with "needs reproduction" will be closed if they have no activity within 3 days. |
https://github.com/frangio/repro-abitype-error See error with |
We had this same problem when we started to use TS 5.2.2. This was because of a change in typescript's module/moduleResolution that you can check here. To have it run as cjs your "module": "CommonJS",
"moduleResolution": "Node10" Some more details of the changes in typescript can be found on this PR and this issue. Hope this help! |
Updating abitype so that it says |
What we need to do is to emit |
Oh, that actually seems to be the case already: This made me realize that the error only happens if my project has Closing this issue. FWIW, I don't think there is any possible workaround that abitype could implement. |
After some more experimentation I've found that the error is caused by having |
This issue has been locked since it has been closed for more than 14 days. If you found a concrete bug or regression related to it, please open a new bug report with a reproduction against the latest ABIType version. If you have any other comments you can create a new discussion. |
Describe the bug
I'm seeing the following compiler error when using TypeScript 5.2.2:
I have these settings in my tsconfig.json:
I noticed that abitype publishes CommonJS files with a
.js
extension, even though in package.json it says"type": "module"
. Manually changing"type": "module"
to"type": "commonjs"
fixes the compiler error. This seems like an odd fix because ES modules are also published with a.js
extension, however those are perhaps hardcoded to be interpreted as ES modules because they are reached through the explicit"import"
entrypoints?Link to Minimal Reproducible Example
The playground doesn't work with ES Modules.
Steps To Reproduce
No response
Package Version
0.10.1
I don't see the same issue with 0.9.10.
TypeScript Version
5.2.2
Anything else?
No response
Validations
The text was updated successfully, but these errors were encountered: