Upgrade angular 7 to 8, ERROR: this.typeChecker.getTypeArguments is not a function on Build Library
Asked Answered
H

1

5

After upgrade my complex project based on this Guide:

When I build my library I got this error:

Building Angular Package

------------------------------------------------------------------------------
Building entry point 'my-library'
------------------------------------------------------------------------------
Compiling TypeScript sources through ngc
ERROR: this.typeChecker.getTypeArguments is not a function
An unhandled exception occurred: this.typeChecker.getTypeArguments is not a function
See "XXXXXX\angular-errors.log" for further details.

I update Node.js, Typescript and Ancular.Cli Globally

All steps done successfully.

Should I do something to upgrade my Library separately?

Update:

To build i use this command ng build my-library-name with this package ng-packagr": "^5.4.0

All library are in one project, and project upgrade with ng update

Node Version: 12.14.1, Typescript version: 3.4.5

Herzig answered 14/1, 2020 at 10:43 Comment(6)
how are you packaging you library?? is it using npmjs.com/package/ng-packagrAdjacent
you have to upgrade all the libraries individually for it to work in your main appAdjacent
what is your node version??Adjacent
I have the same problem while building library with Angular 6.1.10.Plutus
check my answer, maybe it help you tooHerzig
Yeap, it helped, thx.Plutus
H
18

I find an issue in tsickle repository Here.

Based on this issue, angular library raised error when tsickle 0.38.0 installed.

Issue available here.

New version of tsickle (0.36.0) gives an error trying to build a library using ng build. Works fine with previous version( 0.35.0)

I revert the tsickle to version 0.35.0, and error gone.

Herzig answered 15/1, 2020 at 10:9 Comment(1)
Thanks! - although I only had to revert to 0.37.0 to get it to work.Rationale

© 2022 - 2024 — McMap. All rights reserved.