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

Module resolution: Full Node.js 23+ TS support #61355

Open
jacob-ebey opened this issue Mar 5, 2025 · 0 comments
Open

Module resolution: Full Node.js 23+ TS support #61355

jacob-ebey opened this issue Mar 5, 2025 · 0 comments

Comments

@jacob-ebey
Copy link

jacob-ebey commented Mar 5, 2025

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 here

{
    "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"
    ]
}

Run tsc --traceResolution and paste its output here

log.txt

Paste the package.json of the importing module, if it exists

{
  "type": "module",
  "scripts": {
    "start": "node a.ts"
  },
  "devDependencies": {
    "typescript": "^5.8.2"
  }
}

Paste the package.json of the target module, if it exists

{
  "type": "module",
  "scripts": {
    "start": "node a.ts"
  },
  "devDependencies": {
    "typescript": "^5.8.2"
  }
}

Any other comments can go here

Seems we need a way to say exactFileExtensions: true to fully support Node.js.

@jacob-ebey jacob-ebey changed the title Module resolution: Module resolution: Full Node.js 23+ TS support Mar 5, 2025
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

1 participant