Change8

Migrating to TypeScript v5.8.3

Version v5.8.3 introduces 2 breaking changes. This guide details how to update your code.

Released: 10/1/2025

2
Breaking Changes
3
Migration Steps
5
Affected Symbols

⚠️ Check Your Code

If you use any of these symbols, you need to read this guide:

--erasableSyntaxOnly--module node18importrequiretsconfig.json

Breaking Changes

Issue #1

Granular checks for 'use strict' in files: TypeScript now strictly enforces that certain prologue directives cannot appear after non-prologue statements.

Issue #2

Restrictions on Import Assertions: The deprecated 'assert' syntax in imports now triggers a warning/error in favor of 'with' (attributes).

Migration Steps

  1. 1
    If using Node.js 18+, consider updating 'module' and 'moduleResolution' settings to 'node18' in tsconfig.json.
  2. 2
    Replace 'assert { type: "json" }' with 'with { type: "json" }' in dynamic and static imports.
  3. 3
    Check for new errors if using strict prologue directives (e.g., 'use strict').

Release Summary

TypeScript 5.8 introduces the --erasableSyntaxOnly flag, support for Node.js 18 module resolution, and optimizations for ESM interoperability while deprecating older import assertion syntax.

Need More Details?

View the full release notes and all changes for TypeScript v5.8.3.

View Full Changelog