bold-commerce / bold-subscriptions-js

This Javascript API makes it easy to add subscriptions to the cart and navigate to the Bold Subscriptions or Cashier checkout.
MIT License
6 stars 0 forks source link

regeneratorRuntime Error #7

Open trst opened 4 years ago

trst commented 4 years ago

Hello,

I've added the bold-subscriptions-js to a Shopify site via the CDN method. When ever I access the BoldSubscriptions.cart.standard.addToCart() method, I see an error log like this one:

Uncaught ReferenceError: regeneratorRuntime is not defined

I suspect this is a babel issue based on a cursory search but I'd be happy for it to be user error and something that could be corrected pretty quickly :wink: I can provide more details if needed.

trst commented 4 years ago

For what it's worth, I solved by building from source and modifying the package.json Browserlists property to:

"browserslist": [
  "since 2017-06"
]

Certainly not as backwards compatible, but for my use case (i.e., assuming async capable browsers) it seems to work :woman_shrugging:

Is it worth submitting a pull request?

morgan-wowk commented 3 years ago

Hi all,

So sorry for the delay in replies here. Since the inception of this library Bold has introduced and now matured the version 2 of our Subscriptions application. I myself have been working on that v2 for a while and am just seeing some of these comments.

I really appreciate that you took the time to build from source and shared your solution.

I did receive feedback internally about a related issue and may have solved this when adding @babel/core to have better IE11 support. I tested and was unable to reproduce this issue today using the CDN version.

Closing this issue for the time being and looking forward to being more reactive on any BS2 library I may contribute to or publish in the future.

Kyon147 commented 3 years ago

I'm also getting this same error on a client website.

morgan-wowk commented 3 years ago

@Kyon147 Would you be able to let me know the browser, browser version and if you are also using the BoldSubscriptions.cart.standard.addToCart() function?

Kyon147 commented 3 years ago

@Kyon147 Would you be able to let me know the browser, browser version and if you are also using the BoldSubscriptions.cart.standard.addToCart() function?

Sure thing, Chrome, Version 91.0.4472.77 (Official Build) (x86_64)

morgan-wowk commented 3 years ago

As a temporary solution, please consider trying the suggested fix above, locally, and compiling from source using yarn build-cdn. Actively looking at this though. Thanks for your patience

morgan-wowk commented 3 years ago

Can you let me know if there's any differences in what I am doing here compared to your implementation? Seems to be working okay on chrome version 91.

Screen Shot 2021-06-22 at 3 49 25 PM Screen Shot 2021-06-22 at 3 50 14 PM
morgan-wowk commented 3 years ago

I have added the beta version 1.2.8-beta that you can try out.

For CDN, the URL is:

https://unpkg.com/@boldcommerce/bold-subscriptions-js@1.2.8-beta/dist/bold-subscriptions-js.min.js

Please let me know how this works out for you.