Shopify / buy-button-js

BuyButton.js is a highly customizable UI library for adding ecommerce functionality to any website.
http://shopify.github.io/buy-button-js/
MIT License
244 stars 114 forks source link

ProductSet TypeError and Cross-Site Resource Warnings #705

Open heart-of-code opened 4 years ago

heart-of-code commented 4 years ago

Render a productSet with iFrame set to false e.g.

ui.createComponent('productSet', {
        id: 'XXX',
        node: document.getElementById('product-component'),
        options: {
                productSet: {
                        iframe: false
                }
        }
}

Produces the following error:

TypeError: component.trackingInfo.forEach is not a function
    at UI.trackComponent (buybutton.umd.js:15751)
    at buybutton.umd.js:15734

As well as the following warning:

A cookie associated with a cross-site resource at http://shopify.com/ was set without the `SameSite` attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with `SameSite=None` and `Secure`. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5088147346030592 and https://www.chromestatus.com/feature/5633521622188032.

Codepen (fill in your own shopify domain/token/product id) https://codepen.io/iamducke/pen/xxZoRVN

CodyHenslee commented 4 years ago

I am experiencing the exact same warning. It has me worried that my shop will just stop once Chrome blocks these from loading. Can't really have customers if I can't load my products.

CodyHenslee commented 4 years ago

Have there been any updates to this? I am using Buy Button JS on my website to link back to products in my Shopify store but I continue to get the following "issues" warning in Chrome's developer console. It appears to be due to the response from Shopify not setting the "same-site" cookie attribute correctly. Please help!

"A cookie associated with a cross-site resource at http://shopify.com/ was set without the SameSite attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with SameSite=None and Secure. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5088147346030592 and https://www.chromestatus.com/feature/5633521622188032."