Angular 9: failed to build an angular library in v9.1.0 which dependes on other angular library

196 views Asked by At

I'm upgrading my Angular library to version 9, in my project I use Angular v9.1.0.

And my library relies on another internal Angular library. When I try to build my library, II got the following errors:

node_modules/anotherAngularLib/tooltip/tooltip.directive.d.ts:111rror TS2314: Generic type 'ɵɵFactoryDef' requires 2 type argument(s

111     static ɵfac: ɵngcc0.ɵɵFactoryDef<TooltipDirective>;

I checked the code of the dependency library, it was developed with angular v9.0.5.

My understanding is the angular/core's definition of this method changed between v9.1.0 and v9.0.5.

I checked the changes of Angular and confirmed my guess and the change of the method.

What still confuses me is why the above issue happens.

My understanding is that when an Angular library is built and published, it will generate some files after compilation, and inside the files, the APIs of angular/core will be imported and the APIs will be based on the version of Angular in the build time.

In my case, the dependency library was built with v9.0.5. But my library uses v9.1.0. That's the reason for the above error.

Is my understanding correct?

0

There are 0 answers