timofei-iatsenko / angular-cc-library

Library to support Credit Card input masking and validation
MIT License
82 stars 71 forks source link

Compatibility issues with Angular 14 #117

Closed filipRisteski closed 1 year ago

filipRisteski commented 1 year ago

Today I started getting compatibility issues. I tried all 3* versions of the component. I tried various 14 of angular/core to see if some of them will make a difference, but without success. Apart from intervening manually in node_modules I have no other way to resolve this, which is bad for CI.

Yes I tried removing node_modules, I tried both on Node 16 and Node 18. #

This is the log output:


Error: node_modules/angular-cc-library/lib/directives/credit-card-format.directive.d.ts:28:18 - error TS2707: Generic type 'ɵɵDirectiveDeclaration' requires between 6 and 8 type arguments.

28     static ɵdir: i0.ɵɵDirectiveDeclaration<CreditCardFormatDirective, "[ccNumber]", ["ccNumber"], {}, {}, never, never, false, never>;
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: node_modules/angular-cc-library/lib/directives/cvc-format.directive.d.ts:17:18 - error TS2707: Generic type 'ɵɵDirectiveDeclaration' requires between 6 and 8 type arguments.

17     static ɵdir: i0.ɵɵDirectiveDeclaration<CvcFormatDirective, "[ccCVC]", never, {}, {}, never, never, false, never>;
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: node_modules/angular-cc-library/lib/directives/expiry-format.directive.d.ts:24:18 - error TS2707: Generic type 'ɵɵDirectiveDeclaration' requires between 6 and 8 type arguments.

24     static ɵdir: i0.ɵɵDirectiveDeclaration<ExpiryFormatDirective, "[ccExp]", never, {}, {}, never, never, false, never>;
timofei-iatsenko commented 1 year ago

Yesterday I bumped the version of angular compiler to v15 and build library with it, that probably might be the case. But you mentioned you check previous version and it still doesn't work?

timofei-iatsenko commented 1 year ago

Just created a minimal repo on StackBlitz and looks like it working https://stackblitz.com/edit/angular-ivy-rvjn1d?file=src/app/app.component.html

Could you try to reproduce it in isolation and send me a link to the repo?

timofei-iatsenko commented 1 year ago

Indeed, I've just created a clean project using AngularCli@14 on my local machine and installed latest version of the package and got the same errors. But downgrading to 3.0.1 helped. So you need to check your configuration.

Distribution created with Angular 15 is not compatible with angular 14. I will revert version bump in patch and apply it as minor.

timofei-iatsenko commented 1 year ago

Angular 15 was reverted in 3.0.x so you can use either 3.0.1 or latest 3.0.4. I've added a version compatibility table into Readme.

Sorry for the inconvenience.

filipRisteski commented 1 year ago

Great thanks, let me know if there is a version which I can try where you also support angular 15 and see if the problem is still there. I can test this in a day or two.

In the meantime CI builds seem to be OK now.

timofei-iatsenko commented 1 year ago

3.1.* supports Angular 15