Shopify / Shopify/buy-button-js
ProductSet TypeError and Cross-Site Resource Warnings
Open
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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