gund / ng-dynamic-component

Dynamic components with full life-cycle support for inputs and outputs for Angular
https://malkevich-alex.gitbook.io/ng-dynamic-component/
MIT License
561 stars 65 forks source link

Building app with angular 13 leads to compile error #473

Closed sotjdisc closed 2 years ago

sotjdisc commented 2 years ago

./node_modules/ng-dynamic-component/fesm2015/ng-dynamic-component.mjs - Error: Module build failed (from ./node_modules/@angular-devkit/build-angular/src/babel/webpack-loader.js): TypeError: Cannot create property 'message' on string 'Y:\inventory\inventory-web-ui\node_modules\ng-dynamic-component\fesm2015\ng-dynamic-component.mjs: This application depends upon a library published using Angular version 14.0.1, which requires Angular version 14.0.0 or newer to work correctly. Consider upgrading your application to use a more recent version of Angular. 26 | } 27 | /* @nocollapse / ComponentOutletInjectorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: ComponentOutletInjectorDirective, deps: [{ token: i1.NgComponentOutlet, host: true }], target: i0.ɵɵFactoryTarget.Directive });

28 | /* @nocollapse / ComponentOutletInjectorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.1", type: ComponentOutletInjectorDirective, selector: "[ngComponentOutlet]", providers: [ | ^ 29 | { 30 | provide: DynamicComponentInjectorToken, 31 | useExisting: ComponentOutletInjectorDirective,' at run (Y:\inventory\inventory-web-ui\node_modules\@babel\core\lib\transformation\index.js:37:15) at run.next () at Function.transform (Y:\inventory\inventory-web-ui\node_modules\@babel\core\lib\transform.js:25:41) at transform.next () at step (Y:\inventory\inventory-web-ui\node_modules\gensync\index.js:261:32) at Y:\inventory\inventory-web-ui\node_modules\gensync\index.js:273:13 at async.call.result.err.err (Y:\inventory\inventory-web-ui\node_modules\gensync\index.js:223:11) at Y:\inventory\inventory-web-ui\node_modules\gensync\index.js:189:28 at Y:\inventory\inventory-web-ui\node_modules\@babel\core\lib\gensync-utils\async.js:74:7 at Y:\inventory\inventory-web-ui\node_modules\gensync\index.js:113:33

Error: node_modules/ng-dynamic-component/lib/component-injector/component-outlet-injector.directive.d.ts:10:18 - error TS2314: Generic type 'ɵɵDirectiveDeclaration' requires 6 type argument(s).

10 static ɵdir: i0.ɵɵDirectiveDeclaration<ComponentOutletInjectorDirective, "[ngComponentOutlet]", ["ndcComponentOutletInjector"], {}, {}, never, never, false>;


Error: node_modules/ng-dynamic-component/lib/dynamic-attributes/dynamic-attributes.directive.d.ts:28:18 - error TS2314: Generic type 'ɵɵDirectiveDeclaration' requires 6 type argument(s).

28     static ɵdir: i0.ɵɵDirectiveDeclaration<DynamicAttributesDirective, "[ndcDynamicAttributes],[ngComponentOutletNdcDynamicAttributes]", ["ndcDynamicAttributes"], { "ndcDynamicAttributes": "ndcDynamicAttributes"; "ngComponentOutletNdcDynamicAttributes": "ngComponentOutletNdcDynamicAttributes"; }, {}, never, never, false>;

Error: node_modules/ng-dynamic-component/lib/dynamic-directives/dynamic-directives.directive.d.ts:59:18 - error TS2314: Generic type 'ɵɵDirectiveDeclaration' requires 6 type argument(s).

59 static ɵdir: i0.ɵɵDirectiveDeclaration<DynamicDirectivesDirective, "[ndcDynamicDirectives],[ngComponentOutletNdcDynamicDirectives]", never, { "ndcDynamicDirectives": "ndcDynamicDirectives"; "ngComponentOutletNdcDynamicDirectives": "ngComponentOutletNdcDynamicDirectives"; }, { "ndcDynamicDirectivesCreated": "ndcDynamicDirectivesCreated"; }, never, never, false>;


Error: node_modules/ng-dynamic-component/lib/dynamic-io/dynamic-io.directive.d.ts:20:18 - error TS2314: Generic type 'ɵɵDirectiveDeclaration' requires 6 type argument(s).

20     static ɵdir: i0.ɵɵDirectiveDeclaration<DynamicIoDirective, "[ndcDynamicInputs],[ndcDynamicOutputs],[ngComponentOutletNdcDynamicInputs],[ngComponentOutletNdcDynamicOutputs]", never, { "ndcDynamicInputs": "ndcDynamicInputs"; "ngComponentOutletNdcDynamicInputs": "ngComponentOutletNdcDynamicInputs"; "ndcDynamicOutputs": "ndcDynamicOutputs"; "ngComponentOutletNdcDynamicOutputs": "ngComponentOutletNdcDynamicOutputs"; }, {}, never, never, false>;

Error: node_modules/ng-dynamic-component/lib/dynamic.component.d.ts:18:18 - error TS2314: Generic type 'ɵɵComponentDeclaration' requires 7 type argument(s).

18 static ɵcmp: i0.ɵɵComponentDeclaration<DynamicComponent, "ndc-dynamic", never, { "ndcDynamicComponent": "ndcDynamicComponent"; "ndcDynamicInjector": "ndcDynamicInjector"; "ndcDynamicProviders": "ndcDynamicProviders"; "ndcDynamicContent": "ndcDynamicContent"; }, { "ndcDynamicCreated": "ndcDynamicCreated"; }, never, never, false>;

gund commented 2 years ago

Looks like the latest version is not compatible with Angular v13...

You need to pin the lib version down to 10.1.x as starting from 10.2.x it's compiled with Angular v14.

sotjdisc commented 2 years ago

The problem is that 10.1.0 is also somehow corrupt and needs Angular 14...

I am using 10.1.1-no-barrels.1 for now, which is fine with Angular 13.

gund commented 2 years ago

Yeah that's probably the reason, up until v14 there was an issue with the barrel exports so you are using correct version. I will update the docs about compatibility with Angular v13 accordingly.

gund commented 2 years ago

:tada: This issue has been resolved in version 10.3.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

willyboy commented 2 years ago

There used to be a compatibility table in the Readme. I was just wondering why that was dropped? If you have a list, I can open a PR for it.

gund commented 2 years ago

@willyboy it's still there just hidden inside of a collapsible element:

image