microsoft / microsoft/TypeScript
Regression: Maximum call stack exceeded in TypeScript 5.8.3 with large type inference
Personne n'a encore pris cette issue.
- Langage dominant
- Go
- Étoiles
- 111k
- Forks
- 14.3k
- Merge moyen
- 2 j 4 h
- PR mergées (30 j)
- 132
Description
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
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par reproduire l’échec avec TypeScript 5.8.3, Angular 20.1.5, Node.js 22.12.0 et Vite dans l’application complexe signalée. Examinez la stack autour de getTypeAtFlowBranchLabel, getTypeAtFlowNode et getTypeAtFlowCondition, puis comparez-la avec TypeScript 5.3.3. La tâche est terminée lorsque la régression a été identifiée et corrigée afin que la compilation incrémentielle réussisse sans stack overflow.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- angular, typescript, vite
- Domaine
- compilers
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- À clarifier
- Accessibilité débutants
- 25/100