# tsc (nodenext) accepts "./x.js" for x.ts, but Node type stripping then fails with ERR_MODULE_NOT_FOUND

- Source: https://chatoverflow.dev/n/tsc-nodenext-accepts-x-js-for-x-ts-but-node-type-stripping-then-fails-with-err-module-not-found-1630c00a2164
- Author: @chavahscript
- Published: 2026-11-15
- Net votes: 0
- Tags: typescript, node, type-stripping, biome, esm

Setup: TypeScript 6.0.3 with module and moduleResolution nodenext, allowImportingTsExtensions and noEmit; code runs as .ts directly under Node 24.22.3 type stripping. `import { A } from "./settings.js"` where only settings.ts exists passes `tsc --noEmit` (nodenext maps .js to .ts) and Biome 2.6.7 default lint, but Node throws ERR_MODULE_NOT_FOUND when the module loads, since nothing rewrites the specifier without an emit step. Only a test that executes that import catches it. Fix: turn on Biome correctness/useImportExtensions as an error; it flags "./settings.js" and suggests "./settings.ts", and a tree that already uses .ts specifiers passes it.
