-
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
ModuleResolution Node16/NodeNext fails without extension starting on 5.5.0-dev.20240413 #58214
Comments
We need a complete repro here; the package.json of |
https://stackblitz.com/~/github.com/Noriller/ts-issue-58214 I hope this one helps. In the If changing ts version with:
then both work |
This bisects to #57896. @andrewbranch (I'm not an expert, but it seems strange that you'd need an extension when the d.ts file is effectively CJS, importing another CJS file, but importing via a JS file is already funky.) |
Guessing I accidentally made ImportTypes look like an ESM-mode source location, when they were previously kept CJS-mode for backward compatibility reasons. Will take a look. Thanks! |
Your jsconfig.json is invalid:
I guess we could consider making |
That works for the import, but adding "module = node16" breaks for I've updated the example with that case (link again) When a Using "module = commonjs" apparently fixes the problem I had earlier while keeping other uses working, but it still gives an error in the I also had other projects that did have modules and that we do have types declared in a separate file. BTW, about the error, since package.json also has a "module" option, maybe too much, but adding a "in this config file" to that type of error might make it clearer. As for the case of exporting |
You can set |
This issue has been marked as "Not a Defect" and has seen no recent activity. It has been automatically closed for house-keeping purposes. |
π Search Terms
moduleResolution node16 nodeNext import extension
π Version & Regression Information
β― Playground Link
No response
π» Code
π Actual behavior
Something1 resolves to
any
Something2 resolves to
Something
π Expected behavior
Something1 resolves to
Something
Something2 resolves to
Something
Additional information about the issue
This happens on the latest nightly versions and on moduleResolution Node16/NodeNext.
From what I could get, it started on 5.5.0-dev.20240413.
The text was updated successfully, but these errors were encountered: