Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
I'm getting the following error in my Javascript console and my Buy Button is not rendering on the web page as a result:
TypeError: Cannot read properties of undefined (reading 'indexOf')
at buy-button-storefront.min.js:10:5524
This looks like an issue w/ Shopify's code, correct? Have they made breaking changes to the API in the last year? The embed code for this button is a couple of years old.
What's strange is that the Buy Button that generated this code has disappeared from my Shopify Settings, so I'll need to create a new one. How could it disappear like that?
I had a similar issue and was able to resolve it by upgrading the version of buybutton from 1.0.0 to 2.4.0
Previously: "https://sdks.shopifycdn.com/buy-button/1.0.0/buybutton.min.js"
Now: "https://sdks.shopifycdn.com/buy-button/2.4.0/buybutton.min.js"
Maybe the docs need updating because it's forever referencing the 1.0.0 build.
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025