Skip to content
Nilay Kabariya

Entry No.031·Tested·Updated ·6 min read

TypeScript 7 migration guide: breaking changes, tested

Upgrading to TypeScript 7.0.2 step by step: the tsconfig options it now rejects, two defaults that break builds from 5.x, and which tools need workarounds.

Verdict

Every option TypeScript 6.0.3 marked as deprecated was a hard error on 7.0.2, and ignoreDeprecations no longer silences it. Two defaults that arrived in 6.0 (strict on, @types not loaded automatically) also break projects coming straight from 5.9.

Tested on

TypeScript
5.9.3 / 6.0.3 / 7.0.2
Node
24.14.0
npm
11.9.0
OS
Windows 11 Pro
Contents
  1. Step 1: check your tools and framework first01
  2. Step 2: remove the options TypeScript 7 rejects02
  3. Step 3: two defaults that break projects coming from 5.x03
  4. Step 4: install TypeScript 704
  5. Step 5: check it’s really 705
  6. The shortcut: go through 6.006
  7. What didn’t work07
  8. How this was tested08
  9. Limits of this test09

TypeScript 7 is the compiler rewritten in Go. For most projects the upgrade comes down to three things: config options that 7 no longer accepts, two defaults that changed in 6.0, and tools that need TypeScript’s JavaScript API, which 7.0 doesn’t ship. I tested each one on TypeScript 5.9.3, 6.0.3 and 7.0.2, one option at a time, and copied every error below from those runs.

Step 1: check your tools and framework first

Before touching tsconfig.json, find out whether anything you use loads typescript as a library. Those tools break on plain TypeScript 7, whatever your config says. From my earlier tests:

  • Broke, fixed by the side-by-side setup: ts-node, ts-jest, typescript-eslint, TypeDoc, ts-loader, Angular 22, Vue’s vue-tsc, NestJS 12, and the type-check commands of Nuxt (nuxi typecheck), Svelte (svelte-check) and Astro (astro check).
  • Worked on plain TypeScript 7: tsc itself, tsx, Vitest, ts-morph, Next.js 16.3.

The details, with every error: 9 tools tested on TypeScript 7 and Next.js, Angular, Vue and NestJS on TypeScript 7.

Step 2: remove the options TypeScript 7 rejects

TypeScript 6.0 warned about these options. TypeScript 7.0 refuses to compile with them:

error TS5102: Option 'baseUrl' has been removed. Please remove it from your configuration.
error TS5108: Option 'target=ES5' has been removed. Please remove it from your configuration.

Each row was tested on its own, in an otherwise empty tsconfig.json:

Option TypeScript 6.0.3 TypeScript 7.0.2 What to do
"baseUrl" ⚠️ deprecated ❌ removed Delete it; paths works without it
"target": "es5" ⚠️ deprecated ❌ removed es2015 or later
"moduleResolution": "node" / "node10" ⚠️ deprecated ❌ removed nodenext, or bundler with a bundler
"moduleResolution": "classic" ⚠️ deprecated ❌ removed nodenext or bundler
"module": "amd" ⚠️ deprecated ❌ removed esnext with bundler
"module": "umd" ⚠️ deprecated ❌ removed esnext with bundler
"module": "system" ⚠️ deprecated ❌ removed esnext with bundler
"module": "none" ⚠️ deprecated ❌ not accepted esnext with bundler
"outFile" ⚠️ deprecated ❌ removed Delete it; let your bundler produce one file
"esModuleInterop": false ⚠️ deprecated ❌ removed Delete the line
"allowSyntheticDefaultImports": false ⚠️ deprecated ❌ removed Delete the line
"downlevelIteration" ⚠️ deprecated ❌ removed Delete the line
"alwaysStrict": false ⚠️ deprecated ❌ removed Delete the line

Options that 6.0.3 already reported as removed, like suppressImplicitAnyIndexErrors, keyofStringsOnly, out and charset, now give error TS5023: Unknown compiler option. So does importsNotUsedAsValues, which 6.0.3 still accepted without a warning.

Every “has been removed” error, and what to change

These are the exact messages TypeScript 7.0.2 printed, one option at a time. Find yours:

error TS5102: Option ‘baseUrl’ has been removed

Delete "baseUrl". Keep paths: in 7.0.2 an @/ alias in paths resolved with no baseUrl at all, relative to the tsconfig.json.

error TS5108: Option ‘moduleResolution=node10’ has been removed

You get this one even if your config says "moduleResolution": "node": TypeScript reports node under its newer name, node10. Change it to "nodenext" (with "module": "nodenext") for code Node runs directly, or "bundler" (with "module": "esnext") for code a bundler builds.

error TS5108: Option ‘moduleResolution=Classic’ has been removed

Same fix as node10: nodenext or bundler.

error TS5108: Option ‘target=ES5’ has been removed

Set "target" to "es2015" or later. If you still ship to ES5 browsers, let your bundler or Babel do that step.

error TS5108: Option ‘module=AMD’ has been removed

Also printed as module=UMD and module=System, after the misleading TS5095 line above. Switch to "module": "esnext" with "moduleResolution": "bundler".

error TS6046: Argument for ‘–module’ option must be: ‘commonjs’, ‘es6’, …

That’s "module": "none", which 7.0.2 no longer lists as a choice. Pick one of the values the message lists, usually esnext.

error TS5102: Option ‘outFile’ has been removed

Delete "outFile" and let your bundler produce the single file.

error TS5102: Option ‘downlevelIteration’ has been removed

Delete the line. With target at es2015 or later, iteration needs no special handling.

error TS5108: Option ‘esModuleInterop=false’ has been removed

The same message also appears as allowSyntheticDefaultImports=false and alwaysStrict=false. Each of these can no longer be turned off: delete the line, and the option stays on.

Step 3: two defaults that break projects coming from 5.x

These changed in TypeScript 6.0, not 7. If you’re already on 6, you have them. If you’re jumping from 5.9 straight to 7, they arrive together with everything above.

strict is on by default. The same file, with a tsconfig.json that sets nothing:

5.9.3 6.0.3 7.0.2
function f(x) { return x; } compiles error TS7006: Parameter 'x' implicitly has an 'any' type. same as 6

If your old config never set strict, you’ll now get every strict-mode error at once. Fix the errors, or set "strict": false explicitly while you work through them.

Installed @types packages aren’t loaded automatically. With @types/node and @types/jest installed and no types in the config:

error TS2591: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig.
error TS2593: Cannot find name 'describe'. Do you need to install type definitions for a test runner?

Both compiled on 5.9.3. On 6.0.3 and 7.0.2, listing them fixed it:

{ "compilerOptions": { "types": ["node", "jest"] } }

Step 4: install TypeScript 7

If nothing in Step 1 breaks for you, install it plainly:

npm install -D typescript@7.0.2

If a tool or framework in Step 1 breaks, use the side-by-side setup Microsoft describes in the TypeScript 7.0 announcement. tsc runs 7, and tools that import typescript get a TypeScript 6 API:

npm install -D "@typescript/native@npm:typescript@7.0.2" "typescript@npm:@typescript/typescript6@^6.0.2"

Either way, delete node_modules and install again. When I switched a project with a plain npm install, tsc quietly stayed on the old version.

Step 5: check it’s really 7

npx tsc --version
npx tsc --noEmit

The first should print Version 7.0.2. The second type-checks the whole project with your updated config; then run your usual build and tests.

The shortcut: go through 6.0

Every option that failed on 7.0.2 in Step 2 already produced a warning on 6.0.3 that names TypeScript 7:

error TS5101: Option 'baseUrl' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.

So if you’re on 5.x, upgrading to 6.0 first and fixing those warnings (without ignoreDeprecations) gives you a config that 7 accepts. The one gap I found: importsNotUsedAsValues, which 6.0.3 accepted silently and 7.0.2 didn’t recognise.

What didn’t work

How this was tested

A small project with one source file, compiled by TypeScript 5.9.3, 6.0.3 and 7.0.2 (the last two installed side by side as tsc6 and tsc). Each option in the table was tested alone, in an otherwise empty tsconfig.json with noEmit, and each replacement was tested the same way. The @types checks used @types/node and @types/jest from an ordinary install. Every error above is copied from those runs.

Limits of this test

It covers the compiler options and defaults that change between versions, not every type-checking difference inside the new compiler. A large codebase can also hit new type errors that depend on its own code. Run npx tsc --noEmit on 7 before you commit to the upgrade.

— N.K., end of entry No.031

Useful? Pass it on:Post on XFollow @EmotionalMatter

Related entries

  1. No.020

    Upgrading to TypeScript 7? 9 tools tested (ESLint, Jest, ts-node)

    Plain TypeScript 7 broke ts-node, ts-jest, typescript-eslint, TypeDoc and ts-loader, and npm refused to install it at all without a flag. Microsoft's side-by-side setup ran all 9 tools with no errors while tsc stayed on 7.

    TESTED6 min
  2. No.022

    Fix: typescript-eslint does not support TS 7.0 (ESLint on TS 7)

    When typescript-eslint will support TypeScript 7, why npm refuses the install, and the setup that keeps TypeScript 7 while ESLint runs normally today.

    > npm error code ERESOLVE

    FIXED3 min
  3. No.016

    Fix: Cannot read properties of undefined (reading 'fileExists')

    ts-node and webpack's ts-loader crash with this on TypeScript 7, before your code even runs. Which versions do it, why npm didn't warn you, and four ways out.

    > C:\project\node_modules\ts-node\dist\configuration.js:91

    FIXED3 min

Post card · Newsletter

Get the next fix in your inbox.

One short email when a new entry is published. No spam, never shared, and you can leave any time.

— Nilay

or follow by RSSor on X

By subscribing you agree to the privacy note. One click to leave.

tip: paste the exact error text