microsoft / microsoft/TypeScript
Regression: Maximum call stack exceeded in TypeScript 5.8.3 with large type inference
Nessuno ha ancora preso questa issue.
- Lingua principale
- Go
- Stelle
- 111k
- Fork
- 14.3k
- Merge medio
- 2g 4h
- PR unite (30g)
- 132
Descrizione
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
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia riproducendo il malfunzionamento con TypeScript 5.8.3, Angular 20.1.5, Node.js 22.12.0 e Vite nell’applicazione complessa segnalata. Esamina lo stack attorno a getTypeAtFlowBranchLabel, getTypeAtFlowNode e getTypeAtFlowCondition, quindi confrontalo con TypeScript 5.3.3. L’attività è completata quando la regressione è stata identificata e risolta, in modo che la compilazione incrementale riesca senza uno stack overflow.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- angular, typescript, vite
- Ambito
- compilers
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 25/100