microsoft / microsoft/TypeScript

Regression: Maximum call stack exceeded in TypeScript 5.8.3 with large type inference

Offen
#62,289 3 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Needs More Info
Vorherrschende Sprache
Go
Sterne
111k
Forks
14.3k
Ø Merge
1 T. 19 Std.
Gemergte PRs (30 T.)
117

Beschreibung

Description:
We just upgraded our Angular app from version 18 to 20 and, consequently, our TS version to 5.8.3 (the latest compatible version with Angular 20) and are experiencing a "Maximum call stack exceeded" error when compiling our project with TypeScript 5.8.3 - but only in dev mode. It compiles without issue initially, but upon making any changes, we get this error. This appears to be a regression related to complex type inference or large type definitions and did not happen in Angular 18 when using TS 5.3.3.
This only happens in our complex app and not in simpler projects.

Reproduction Steps:

  1. Install TypeScript 5.8.3 and and Angular 20 app with complex types.

Expected Behavior:
The project should compile successfully without a "Maximum call stack exceeded" error, as it did in TypeScript 5.3.3 and Angular 18.

Actual Behavior:
The compilation fails with
RangeError: Maximum call stack size exceeded at getTypeAtFlowBranchLabel (/PATH_TO_FILE/node_modules/typescript/lib/typescript.js:74199:38) at getTypeAtFlowNode (/PATH_TO_FILE/node_modules/typescript/lib/typescript.js:74009:48) at getTypeAtFlowCondition (/PATH_TO_FILE/node_modules/typescript/lib/typescript.js:74161:24) at getTypeAtFlowNode (/PATH_TO_FILE/node_modules/typescript/lib/typescript.js:74001:18) at getTypeAtFlowCondition (/PATH_TO_FILE/node_modules/typescript/lib/typescript.js:74161:24) at getTypeAtFlowNode (/PATH_TO_FILE/node_modules/typescript/lib/typescript.js:74001:18) at getTypeAtFlowCondition (/PATH_TO_FILE/node_modules/typescript/lib/typescript.js:74161:24) at getTypeAtFlowNode (/PATH_TO_FILE/node_modules/typescript/lib/typescript.js:74001:18) at getTypeAtFlowCondition (/PATH_TO_FILE/node_modules/typescript/lib/typescript.js:74161:24) at getTypeAtFlowNode (/PATH_TO_FILE/node_modules/typescript/lib/typescript.js:74001:18)

Environment:

  • TypeScript Version: 5.8.3
  • Angular 20.1.5
  • Node.js Version: 22.12.0
  • Operating System: MacOS
  • Build Tools: Vite - from Angular 20

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, den Fehler mit TypeScript 5.8.3, Angular 20.1.5, Node.js 22.12.0 und Vite in der gemeldeten komplexen Anwendung zu reproduzieren. Untersuche den Stack rund um getTypeAtFlowBranchLabel, getTypeAtFlowNode und getTypeAtFlowCondition und vergleiche ihn anschließend mit TypeScript 5.3.3. Abgeschlossen ist die Aufgabe, wenn die Regression identifiziert und behoben wurde, sodass die inkrementelle Kompilierung ohne einen Stack Overflow erfolgreich ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
angular, typescript, vite
Bereich
compilers
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.