# Stripe JS error while creating new payment method

**URL:** <https://forum.bubble.io/t/stripe-js-error-while-creating-new-payment-method/96992>\
**Category:** Plugins\
**Created:** [June 13, 2020, 6:37pm UTC](https://forum.bubble.io/t/stripe-js-error-while-creating-new-payment-method/96992 "2020-06-13T18:37:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![michelduprez](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/michelduprez/32/58151_2.png) [@michelduprez](https://forum.bubble.io/u/michelduprez)\
**Post date:** [June 13, 2020, 6:37pm UTC](https://forum.bubble.io/t/stripe-js-error-while-creating-new-payment-method/96992/1 "2020-06-13T18:37:32Z")

</div>

Hi,

This error while trying to create a new Payment Method.

```
The plugin Stripe.js / element Stripe element threw the following error: TypeError: Cannot read property 'destroy' of undefined
    at Object.a.data.generateStripe (PLUGIN_Stripe-js-initialize--Stripe-element-.js:4:471)
    at eval (PLUGIN_Stripe-js-update--Stripe-element-.js:3:395) (please report this to the plugin author)

```

Any idea, someone ?

Thank you,

Michel

---

<div class="post-metadata">

**Author:** ![michelduprez](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/michelduprez/32/58151_2.png) [@michelduprez](https://forum.bubble.io/u/michelduprez)\
**Post date:** [June 14, 2020, 9:23am UTC](https://forum.bubble.io/t/stripe-js-error-while-creating-new-payment-method/96992/2 "2020-06-14T09:23:30Z")

</div>

Auto answer for posterity: Stripe’s error log is very accurate. In this case, I was using my real credit card in the test environment, whereas you have to limit yourself to the numbers provided for that (such as 4242 4242 4242 4242).

Now, payment method has been correctly created.

I hope this will help other adventurers.

---

<div class="post-metadata">

**Author:** ![accts](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/accts/32/170410_2.png) [@accts](https://forum.bubble.io/u/accts)\
**Post date:** [July 22, 2023, 8:35pm UTC](https://forum.bubble.io/t/stripe-js-error-while-creating-new-payment-method/96992/3 "2023-07-22T20:35:49Z")

</div>

Did not work for me, unfortunately. I do have correct APUI for Dev but still get error.
