abpframework / abp

Open-source web application framework for ASP.NET Core! Offers an opinionated architecture to build enterprise software solutions with best practices on top of the .NET. Provides the fundamental infrastructure, cross-cutting-concern implementations, startup templates, application modules, UI themes, tooling and documentation.
https://abp.io
GNU Lesser General Public License v3.0
12.69k stars 3.4k forks source link

Angular(ts-toolbel): project does not compile with typescript >= 5.4.0 #19905

Closed hillin closed 3 weeks ago

hillin commented 3 months ago

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

sumeyyeKurtulus commented 3 months ago

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.

hillin commented 3 months ago

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.