Angular project does not compile with typescript > 5.4.0
Version: 8.1.3
User Interface: Angular
Description
When upgrading to typesript ~5.4.0 (5.4.5 to be exact), the abp angular project does not compile
X [ERROR] TS2589: Type instantiation is excessively deep and possibly infinite. [plugin angular-compiler]
node_modules/ts-toolbelt/out/index.d.ts:3892:11:
3892 │ 0: __Assign<Merge<Os[Pos<I>], O, depth, style, noMerge>,...
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
X [ERROR] TS2321: Excessive stack depth comparing types 'Merge<Os[Pos<I>], O, depth, style, noMerge>' and 'object'. [plugin angular-compiler]
node_modules/ts-toolbelt/out/index.d.ts:3892:20:
3892 │ ... __Assign<Merge<Os[Pos<I>], O, depth, style, noMerge>, Os, de...
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
X [ERROR] TS2589: Type instantiation is excessively deep and possibly infinite. [plugin angular-compiler]
node_modules/ts-toolbelt/out/index.d.ts:4544:11:
4544 │ 0: __MergeAll<Merge<O, Os[Pos<I>], depth, style, noMerge...
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
X [ERROR] TS2321: Excessive stack depth comparing types 'Merge<O, Os[Pos<I>], depth, style, noMerge>' and 'object'. [plugin angular-compiler]
node_modules/ts-toolbelt/out/index.d.ts:4544:22:
4544 │ ..._MergeAll<Merge<O, Os[Pos<I>], depth, style, noMerge>, Os, de...
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
X [ERROR] TS2589: Type instantiation is excessively deep and possibly infinite. [plugin angular-compiler]
node_modules/ts-toolbelt/out/index.d.ts:4736:11:
4736 │ 0: __PatchAll<Patch<O, Os[Pos<I>], depth, style, noMerge...
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
X [ERROR] TS2321: Excessive stack depth comparing types 'Patch<O, Os[Pos<I>], depth, style, noMerge>' and 'object'. [plugin angular-compiler]
node_modules/ts-toolbelt/out/index.d.ts:4736:22:
4736 │ ..._PatchAll<Patch<O, Os[Pos<I>], depth, style, noMerge>, Os, de...
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I thinks this is because @abp/ng.core referenced an ancient version of ts-toolbelt which does not work with the new typescript compiler any more.
Reproduction Steps
- Create an ABP Angular project
- Upgrade typescript to 5.4.0
- Run
ng serve
Hello @hillin may I ask whether you have a specific reason to upgrade the typescript version to 5.4.0? Because, abp 8.1.3 supports 17.1.0 for angular that is compatible with ts 5.3.0. Currently, the library ts-toolbelt is not compatible with that typescript version and this will be fixed for the abp version 8.3.0.
Hi! It's because we are trying to upgrade to Angular 18(rc3), which requires Typescript 5.4+. It's just an experiment and we can definitely wait for ABP 8.3.