richnologies / ngx-stripe

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

Please make sure the Element you are attempting to use is still mounted. #15

Closed dottodot closed 6 years ago

dottodot commented 6 years ago

When I'm trying to createToken I get the error

Please make sure the Element you are attempting to use is still mounted.

I don't really understand how it can't be mounted, I'm using the same implementation you've documented i.e I mount the card using

     this.card.mount(this.cardRef.nativeElement);

and the field works as I'd expect until requesting the token.

dottodot commented 6 years ago

I found the cause. I have a different layout for my checkout and the encapsulation was set to ViewEncapsulation.Native. Removing that got rid of the problem