We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
https://github.com/jacob-ebey/ts-resolution-reproduction
The module specifier resolves at build time, but shouldn't because it doesn't at runtime
Within a.ts, import { test } from "./b.js" should not resolve as it is an invalid specifier at runtime.
a.ts
import { test } from "./b.js"
tsc --showConfig
{ "compilerOptions": { "target": "esnext", "module": "nodenext", "moduleResolution": "nodenext", "allowImportingTsExtensions": true, "rewriteRelativeImportExtensions": true, "verbatimModuleSyntax": true, "moduleDetection": "force", "isolatedModules": true, "esModuleInterop": true, "allowSyntheticDefaultImports": true, "resolvePackageJsonExports": true, "resolvePackageJsonImports": true, "preserveConstEnums": true, "useDefineForClassFields": true }, "files": [ "./a.ts", "./b.ts" ] }
tsc --traceResolution
log.txt
package.json
{ "type": "module", "scripts": { "start": "node a.ts" }, "devDependencies": { "typescript": "^5.8.2" } }
Seems we need a way to say exactFileExtensions: true to fully support Node.js.
exactFileExtensions: true
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Demo Repo
https://github.com/jacob-ebey/ts-resolution-reproduction
Which of the following problems are you reporting?
The module specifier resolves at build time, but shouldn't because it doesn't at runtime
Demonstrate the defect described above with a code sample.
Within
a.ts
,import { test } from "./b.js"
should not resolve as it is an invalid specifier at runtime.Run
tsc --showConfig
and paste its output hereRun
tsc --traceResolution
and paste its output herelog.txt
Paste the
package.json
of the importing module, if it existsPaste the
package.json
of the target module, if it existsAny other comments can go here
Seems we need a way to say
exactFileExtensions: true
to fully support Node.js.The text was updated successfully, but these errors were encountered: