The customer was on the home page of the demo store on a CPH2381 phone using Chrome on Android 14. They were trying to scroll down and add a best seller product to the cart. When they did this, an error message appeared instead of the item being added successfully. They expected the product to be added to the cart normally. The issue seems to be related to the add-to-cart request on the home page, with a likely related error showing a 404 POST to /products/undefined and a JSON parsing failure.
500 requests · 2 failed
Cart: 0 → 0 items (changed)
Read before changing your store
This is a suggestion, not a guaranteed fix. It's based on your store's code and what this recording captured.
Customers cannot add the product to cart from this page, so you may be losing orders.
SyntaxError: Failed to execute 'json' on 'Response': Unexpected end of JSON input
The product form is submitting to `/products/undefined`, which means the form action or product URL being used by `product-form.js` is missing/invalid on this page. The JSON parse error happens because the failed request returns an empty/invalid response after the bad POST target
if (!customElements.get('product-form')) { customElements.define('product-form', class ProductForm extends HTMLElement { constructor() { super(); this.form = this.querySelector('form'); this.form.querySelector('[name=id]').disabled = false; this.form.addEventListener('submit', this.onSubmitHandler.bind(this)); this.cart = document.querySelector('cart-notification') || document.querySelector('cart-drawer'); this.submitButton = this.querySelector('[type="submit"]'); if (document.querySelector('cart-drawer')) this.submitButton.setAttribute('aria-haspopup', 'dialog'); this.hideErrors = this.dataset.hideErrors === 'true'; } onSubmitHandler(evt) { evt.preventDefault(); if (this.submitButton.getAttribute('aria-disabled') === 'true') return; this.handleErrorMessage();
if (!customElements.get('product-form')) { customElements.define('product-form', class ProductForm extends HTMLElement { constructor() { super(); this.form = this.querySelector('form'); this.form.querySelector('[name=id]').disabled = false; this.form.addEventListener('submit', this.onSubmitHandler.bind(this)); this.cart = document.querySelector('cart-notification') || document.querySelector('cart-drawer'); this.submitButton = this.querySelector('[type="submit"]'); if (document.querySelector('cart-drawer')) this.submitButton.setAttribute('aria-haspopup', 'dialog'); this.hideErrors = this.dataset.hideErrors === 'true'; } onSubmitHandler(evt) { evt.preventDefault(); if (this.submitButton.getAttribute('aria-disabled') === 'true') return; this.handleErrorMessage();
This one needs a developer.
Suggestions are AI-generated from a read-only copy of the store's theme. Twisty Bug Recorder never changes the theme.