Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Type error when using version >3.0.1 with Angular 14 #205

Open
1 of 3 tasks
clates opened this issue Feb 13, 2023 · 4 comments
Open
1 of 3 tasks

Type error when using version >3.0.1 with Angular 14 #205

clates opened this issue Feb 13, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@clates
Copy link

clates commented Feb 13, 2023

Describe the bug A clear and concise description of what the bug is.

When installing @google-pay/button-angular via yarn add @google-pay/button-angular on an Angular 14 project, you will encounter the following error.

Error: node_modules/@google-pay/button-angular/button-angular/lib/google-pay-button.component.d.ts:35:18 - error TS2707: Generic type 'ɵɵDirectiveDeclaration' requires between 6 and 8 type arguments.

35     static ɵdir: i0.ɵɵDirectiveDeclaration<GooglePayButtonComponent, "google-pay-button", never, { "paymentRequest": "paymentRequest"; "environment": "environment"; "existingPaymentMethodRequired": "existingPaymentMethodRequired"; "buttonColor": "buttonColor"; "buttonType": "buttonType"; "buttonSizeMode": "buttonSizeMode"; "buttonLocale": "buttonLocale"; "paymentDataChangedCallback": "paymentDataChangedCallback"; "paymentAuthorizedCallback": "paymentAuthorizedCallback"; "readyToPayChangeCallback": "readyToPayChangeCallback"; "loadPaymentDataCallback": "loadPaymentDataCallback"; "cancelCallback": "cancelCallback"; "errorCallback": "errorCallback"; "clickCallback": "clickCallback"; }, {}, never, never, false, never

To Reproduce Steps to reproduce the behavior:

  1. Initialize a blank Angular 14 repository
  2. yarn add @google-pay/button-angular
  3. Observe that the project fails to compile.
  4. Update the dependency to 3.0.1 / 3.0.0
  5. Observe that the project now compiles.

Expected behavior No type error

Component information:

  • Component

    • React component (@google-pay/button-react)
    • Custom element (@google-pay/button-element)
    • Angular component (@google-pay/button-angular)
  • Component version (e.g. 1.0.0):

    > 3.0.1

Additional context Add any other context about the problem here.

Workaround

3.0.1-3.0.0 compile fine. Suspect something went wrong during the Angular 15 upgrade in the 3.0.2 release.

You could also keep the 3.0.5 and skipLibCheck: true in your tsconfig.json


See a functional example on a fresh Ang14 repository here using 3.0.0 and the non-functional 3.0.5 example here

@clates clates added the bug Something isn't working label Feb 13, 2023
@dmengelt
Copy link
Member

Thanks @clates for reporting this. If you use skipLibCheck: true in your Angular 14 app it works for your. Correct?

@clates
Copy link
Author

clates commented Feb 17, 2023

If you use skipLibCheck: true in your Angular 14 app it works for your. Correct?

Yes, that's correct.

@oritpersik
Copy link

Any news? I don't want to use skipLibCheck: true. and I want to use the updated version of this library ( I work with angular14 too )

@dmengelt
Copy link
Member

@oritpersik Unfortunately not. At the moment you have to use skipLibCheck: true. We will think about potentially supporting multiple major Angular versions in the future.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants