Shopify / js-buy-sdk

The JS Buy SDK is a lightweight library that allows you to build ecommerce into any website. It is based on Shopify's API and provides the ability to retrieve products and collections from your shop, add products to a cart, and checkout.

Home Page:https://shopify.github.io/js-buy-sdk

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CORS error SDK version 0

benfeather opened this issue · comments

I'm using the js-buy-sdk on a site, version 0 (latest). This morning I started getting a CORS error when making an API request. The site has been working fine up until Wednesday (Yesterday), nothing has been changed on our end.

The SDK is loaded from the Shopify CDN:
https://sdks.shopifycdn.com/js-buy-sdk/v0/latest/shopify-buy.umd.polyfilled.min.js

Here is the output in chrome dev tools:

peregrine-cors

Same here. We started seeing this error around the same time as well.

I can't imagine that Shopify would intentionally block external domains from accessing the Storefront API via the JS Buy SDK. That's the whole purpose of this SDK as well as the storefront API.

@benfeather Could you please keep us updated in case you have new information? This is a store-breaking issue and a huge problem for me.

On a side note: Do you use a private app to access your store or have you switched to custom apps? We're still using private apps which should still work as ever but I wonder if this is related. However I'm hesitant to switch to custom apps since there's no way back if that switch has other side effects.

@michaelfeihstel Thanks for confirming this isn't just an issue with our store, I will post an update if I find anything.

This is a store-breaking bug for us as well, I have contacted Shopify support directly but was told to post an issue here.

We are also using private apps, and haven't updated to custom apps for a similar reason.

Good news: For me the issue is suddenly gone. I didn't do anything - I guess Shopify silently fixed it on their end. Can't tell you how relieved I am.

This looks to be resolved for us as well. Going to close the issue.