You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Don't default moduleResolution to node10 for Typescript 6.0 #3147
Typescript 6.0 deprecates "moduleResolution": "node10" and also defaults "module": "esnext" (which in turn defaults "moduleResolution": "bundler" if not specified).
This means that projects that previously had "moduleResolution": "bundler" in their tsconfig.json can now remove that value as it is the default.
However the language server seemingly still sets node10 as the moduleResolution if not specified, meaning that projects that want to use bundler still need to keep that in their tsconfig to prevent errors & warnings such as:
Warn: Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
This came up in a project of mine when upgrading to TS6 and removing the explicit "moduleResolution": "bundler" from my config, and then running svelte-check (which uses the language-server).
Proposed solution
Is there an option to have the language server use whatever is the default moduleResolution based on the tsconfig and whatever version of Typescript is being used, so that we:
a) don't need to explicitly set bundler when its already the default, and
b) language-server doesn't try to use the deprecated resolution node10 in TS 6.0+ projects?
The node10 default is there for historical reasons. Changing it now does seem like a breaking change. So not sure if we can change it now. Having an option not to default to node10 seems a bit weird. If it's editor config, it won't work on svelte-check. You'll need to set the config explicitly anyway.
When we support TS7 we should change that (a lot of things likely work differently there anyway), but agree that we shouldn't/don't need to change it for 6+
I checked what the node10 default does in practice, with svelte-check 4.7.7. It isn't only the warning: svelte-check resolves differently from tsc.
TypeScript 6.0.3, tsconfig with no module/moduleResolution (so tsc uses bundler), and import { sub } from "pkg/sub" where pkg only has exports:
tsc: 0 errors.
svelte-check (default mode): 4 errors and 1 warning. That's TS2307 for pkg/sub in the .ts and the .svelte file, TS2307 inside Svelte's own types for esrap and esrap/languages/ts (no skipLibCheck), and the node10 deprecation warning.
svelte-check --incremental (which runs TypeScript 6.0.3's tsc) and svelte-check --tsgo (TypeScript 7.0.2 via @typescript/native): 0 errors.
With TypeScript 5.9.3, module: "nodenext" and no moduleResolution: tsc 0 errors; svelte-check 2 × TS2307, plus a warning that moduleResolution must be NodeNext. module: "preserve": tsc 0; svelte-check the same 2 × TS2307, with no warning.
I also tried deriving the default through TypeScript's helper. It fixes this reproduction, but stress testing exposed conditional-export and mixed import/require cases that need more work, so I wouldn't propose the three-line change as ready:
With module: "commonjs", the language server later switches module to ESNext, so a package's import condition wins over require.
The module loader's resolution cache doesn't key on import vs require.
Given those compatibility concerns, keeping explicit moduleResolution until the TS 7 work seems reasonable. Is this reproduction useful for that work?
Activity
jasonlyu123 commentedon Oct 19, 2026
The
node10default is there for historical reasons. Changing it now does seem like a breaking change. So not sure if we can change it now. Having an option not to default to node10 seems a bit weird. If it's editor config, it won't work on svelte-check. You'll need to set the config explicitly anyway.dummdidumm commentedon Oct 19, 2026
When we support TS7 we should change that (a lot of things likely work differently there anyway), but agree that we shouldn't/don't need to change it for 6+
xyrolle commentedon Oct 22, 2026
I checked what the
node10default does in practice, with svelte-check 4.7.7. It isn't only the warning: svelte-check resolves differently fromtsc.TypeScript 6.0.3, tsconfig with no
module/moduleResolution(sotscusesbundler), andimport { sub } from "pkg/sub"wherepkgonly hasexports:tsc: 0 errors.svelte-check(default mode): 4 errors and 1 warning. That's TS2307 forpkg/subin the.tsand the.sveltefile, TS2307 inside Svelte's own types foresrapandesrap/languages/ts(noskipLibCheck), and the node10 deprecation warning.svelte-check --incremental(which runs TypeScript 6.0.3'stsc) andsvelte-check --tsgo(TypeScript 7.0.2 via@typescript/native): 0 errors.With TypeScript 5.9.3,
module: "nodenext"and nomoduleResolution:tsc0 errors; svelte-check 2 × TS2307, plus a warning thatmoduleResolutionmust be NodeNext.module: "preserve":tsc0; svelte-check the same 2 × TS2307, with no warning.I also tried deriving the default through TypeScript's helper. It fixes this reproduction, but stress testing exposed conditional-export and mixed import/require cases that need more work, so I wouldn't propose the three-line change as ready:
module: "commonjs", the language server later switchesmoduleto ESNext, so a package'simportcondition wins overrequire.Given those compatibility concerns, keeping explicit
moduleResolutionuntil the TS 7 work seems reasonable. Is this reproduction useful for that work?