Shopify / Shopify/buy-button-js

ProductSet TypeError and Cross-Site Resource Warnings

Open
#705 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
JavaScript
Stars
260
Forks
122
Avg merge
5d 14h
Merged PRs (30d)
2

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the productSet example with iframe set to false using the linked CodePen. Start by inspecting UI.trackComponent around buybutton.umd.js:15751 and trace the trackingInfo value that causes the TypeError. Done means the reported productSet configuration renders without that error and the cross-site resource warning is addressed or clearly explained.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.