richnologies / ngx-stripe

Angular 6+ wrapper for StripeJS
MIT License
219 stars 77 forks source link

No provider for StripeElementsService! #99

Closed vinayak519 closed 4 years ago

vinayak519 commented 4 years ago

"ngx-stripe": "^10.0.3"

Is this a feature request or a bug report?

Bug report or something missing

What's gone wrong?

Implemented as per the documentation but within the template file for ngx-stripe-card, getting the error in console.

Other information

Bellow is the error occurred: NullInjectorError: StaticInjectorError(AppModule)[StripeCardComponent -> StripeElementsService]: StaticInjectorError(Platform: core)[StripeCardComponent -> StripeElementsService]: NullInjectorError: No provider for StripeElementsService!

richnologies commented 4 years ago

Hi @vinayak519,

Thanks for the feedback. I just release a new version 10.0.4 that I think will solve this bug. If the problem persists, please let me know and if possible add extra info about your Angular Version.

R

vinayak519 commented 4 years ago

Hey, Im testing this on angular 8. thanx that works now what was the issue?

richnologies commented 4 years ago

This is a new service for the new major release. It was using the providedIn: 'root'. I just move it to the module like the rest. Glad it work for you. I'll release this for the rest of Angular major versions during the day. You can check the changes here if you have interest:

https://github.com/richnologies/ngx-stripe/commit/9f7604606d8ce2ae2063c57419da3a6f2669f5db

atefnajar commented 1 year ago

i have a problem in stripe v15.7.1 ?? [StripeService -> StripeService -> StripeService -> StripeService]: NullInjectorError: No provider for StripeService! NullInjectorError: R3InjectorError(PaymentModule)[StripeService -> StripeService -> StripeService -> StripeService]: NullInjectorError: No provider for StripeService!