Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hello!
When customers click the 'Add to cart' button on our website, there is an error 'Cannot read properties of undefined (reading 'reduce')' on Chrome browser and 'undefined is not an object (evaluating 'window.theme.cart.store.getState')' error on Safari browser. The button works fine on mobile phone and incognito. We haven't made any changes in the code recently. We use the Venue theme. Why is this happening? How can we fix this?
Thanks in advance.
JavaScript Error: The error indicates that some JavaScript code is trying to access or manipulate data that is undefined or unavailable at that moment. The reduce() function in JavaScript is typically used on arrays, and if it's being called on an undefined object, it will throw this error.
Cache or Session Storage Issue: Since the issue does not occur in incognito mode or on mobile, it could be related to cached data or session storage in the browser. JavaScript might be trying to retrieve cart information from local storage, and if that data is undefined, it causes the error.
If this fixed your issue, likes and accepting as a solution are highly appreciated
| Build an online presence with our custom-built Shopify Theme: EcomifyTheme
| Check out our reviews: Trustpilot Reviews
| We are Shopify Partners: EcomGraduates Shopify Partner
Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025