nomadreservations / ngx-stripe

Angular 8.x wrapper for StripeJS
41 stars 32 forks source link

Angular 9 compatibility #32

Closed alsoicode closed 4 years ago

alsoicode commented 4 years ago

After updating my project to Angular 9 and TypeScript 3.7.5, initializing the <ngx-stripe-card> component in my template is throwing this error:

Screen Shot 2020-02-11 at 5 02 49 PM

I have tried disabling the Ivy compiler in my tsconfig.app.json, but it results in the same error.

paullryan commented 4 years ago

I have been running it with ivy and angular 9 for months so it's not a raw issue with anuglar 9 sounds like your missing something in how your using the it.

justvamp commented 4 years ago

I'm facing exactly the same issue on Angular 9. It worked well before. Component using <ngx-stripe-card> is loading dynamically.

alsoicode commented 4 years ago

@justvamp My use case is similar in that <ngx-stripe-card> is in a fieldset that is conditional with *ngIf

alsoicode commented 4 years ago

@paullryan My apologies, I accidentally opened this defect on your repo instead of the main ngx-stripe repo: https://www.npmjs.com/package/ngx-stripe

Specifying version 1.2.2 of this repo versus 7.4.4 of the ngx-stripe repo works as expected for me, however there seems to be some confusion with the ngx-stripe's repo, because it points to yours as its homepage in npm, which is how I arrived here.

justvamp commented 4 years ago

I made a local copy of <ngx-stripe-card> component (StripeCardComponent), used it and it works well now. The weird thing is that I didn't make any changes in the source code (except changing the selector, of course). So I have no idea of how to fix the issue in this repo.

Anyway this crutchy workaround may help someone until the issue is fixed.

alsoicode commented 4 years ago

@justvamp instaling version 1.2.2 of @nomadreservations/ngx-stripe versus 7.4.4 of ngx-stripefixed the problem for me. I opened the same bug against the ngx-striperepo, which is under a different user, but shares this site in it's npm description, which is confusing.

I'm closing this issue since it doesn't exist on this repo, but on the ngx-stripe repo instead.

bradyisom commented 4 years ago

BTW, there is still a peer dependency issue for Angular 9:

warning " > @nomadreservations/ngx-stripe@1.2.2" has incorrect peer dependency "@angular/common@~8.2.9". warning " > @nomadreservations/ngx-stripe@1.2.2" has incorrect peer dependency "@angular/core@~8.2.9".