-
Notifications
You must be signed in to change notification settings - Fork 726
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
All types are any
when using ESM
#1653
Comments
Hey @danilofuchs, please provide a minimum reproduction code via code sandbox or any other platform. A reproduction repository is another valid choice.
Basically, you are using an esm project with a cjs typescript config: {
// ...
"compilerOptions": {
// ...
"module": "Node16",
"moduleResolution": "Node16",
// ...
}
} If you're working on an ESM context you need to have a proper ESM typescript config: {
// ...
"compilerOptions": {
// ...
"module": "ES2022",
"moduleResolution": "Bundler",
// ...
}
} Closing the issue now. If you think this is a typing issue, please provide a recreation code as I asked and I'll reopen the issue. |
After some consideration (thanks @alecgibson), I double checked docs and realized this is indeed a bug. I should be able to fix this tomorrow. Reopening the issue |
Hey @danilofuchs, @alecgibson, I just released |
Sent this on Discord, but also putting here to increase visibility: Can confirm:
Where digging into the definitions shows this:
And I notice it's both:
I suspect you just need to rename or namespace the import from |
Hey @alecgibson, |
I can confirm [email protected] fixes this issue for me! |
Is there an existing issue for this?
Current behavior
Using inversify 6.1.4 in an ESM project leads to all types being

any
, as the imports in the .d.ts files do not contain.js
extensions:Adding .js manually fixes the types:

Steps to reproduce
Typescript 5.7.2
tsconfig.json:
Expected behavior
Types should work correctly
Possible solution
No response
Package version
6.1.4
Node.js version
22.11.0
In which operating systems have you tested?
Stack trace
No response
Other
No response
The text was updated successfully, but these errors were encountered: