Angular 9 Ivy-일반 유형 ‘typeFactoryDef’에는 2 개의 유형 인수가 필요합니다.

Angular Ivy가 아직 준비되지 않은 것 같습니다. Angular 9의 주요 아이디어 인 ivy를 사용하여 프로젝트를 빌드하려고합니다. 많은 라이브러리 가이 기능과 호환되지 않습니다.이 라이브러리 중 하나는@angular/flex-layout . 입니다. 자재 및 서비스 작업자도 같은 문제가 있습니다.

ng build --prod --aot -c=production스크립트를 사용하여 프로젝트를 빌드 한 후 다음을 얻었습니다.

                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/@angular/flex-layout/core/typings/media-trigger/media-trigger.d.ts:71:18 - error TS2314: Generic type 'ɵɵFactoryDef' requires 2 type argument(s).

71     static ɵfac: ɵngcc0.ɵɵFactoryDef<MediaTrigger>;
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/@angular/flex-layout/extended/typings/show-hide/show-hide.d.ts:18:18 - error TS2314: Generic type 'ɵɵFactoryDef' requires 2 type argument(s).

18     static ɵfac: ɵngcc0.ɵɵFactoryDef<ShowHideStyleBuilder>;
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/@angular/flex-layout/extended/typings/show-hide/show-hide.d.ts:49:18 - error TS2314: Generic type 'ɵɵFactoryDef' requires 2 type argument(s).

49     static ɵfac: ɵngcc0.ɵɵFactoryDef<ShowHideDirective>;

위에서 쓴 것보다 긴 오류로 인해이 문제에 대한 좋은 검색을하기 위해 시간이 걸렸습니다. 테이블에는 아무것도 없지만 좋은 옵션이 아닌 아이비를 비활성화했습니다.



답변

다행히 Angular 9.1이 릴리스되었으며 문제가 해결되었습니다. 9.1로 업그레이드 한 후 node_modules를 삭제하고 다시 설치했습니다. 그런 다음 타이프 스크립트를에서 3.7.5로 업그레이드 했습니다 3.8.3. 이제 ngcc가 제대로 작동하고 있으며 빌드 후 오류가 없습니다.

자세한 정보 : Angular Version 9.1


답변