#chukd-elements-ngx
1 messages · Page 1 of 1 (latest)
Hi what's your question?
Hi Dutchess. Stripe.js is throwing an error when createToken() is called on my custom mounted elements for a card (number, cvc, expiry). The error relates to not retrieving data from the specified Element. Please make sure the Element you are attempting to use is still mounted. I believe it's because I've embedded my stripe elements inside a form stepper and the card elements are on the 2nd step and when I create the token I'm possible in a state where the form stepper has removed the element from the DOM, but not sure. I've been looking for a way to check if the element is mounted when I create the token and did find a method called _isMounted() and it does return a bool: true. But token creation still fails. Is there a way to look into the Stripe.js library to see what is going on and why the failure is occuring. I have a SO post here if you want to take a look - https://stackoverflow.com/q/75656091/1186050
Hi sorry for the delay
Looking now
Ah you use ngx-stripe too
That's tricky because that's a third party library, so I don't know much about it
ya understood, but it's just a wrapper for the Stripe.js lib
There's 2 options here - I can give you access to my dev site, but you'll need to give me your IP address. Option 2 - I can get the form stepper working in my Stackblitz, which I'm having trouble doing and have the post here. https://stackoverflow.com/q/75632961/1186050
Ah ok. I won't give out my IP address, but if you can get it working on Stackblitz let me know
ok
Also Sergey's comment is a good point. Again, not familiar with ngx-stripe, but if that function expects a card element that could be a problem: https://stackoverflow.com/questions/75656091/how-to-check-my-form-stepper-step-has-finished-rendering-before-i-use-the-elemen#comment133521431_75656091
chukd-elements-ngx
ya I understand, I didn't know if you guys would be able to provide any help as the issue is most likely related to ngx-stripe and/or the Angular2-wizard form stepper library. I just thought you guys would have a better insight into how I could look into the Stripe.js library to see if I'm still mounted and how to diagnose that Stripe.js error message.
yeah unfortunately we don't really have a good way to debug this for you