429 Too many requests

I have reproduced the issue on the latest CLI version.

Yes, I am on the latest version

I have searched existing posts and this report is not a duplicate.

Yes, this isn’t a duplicate

In which of these areas are you experiencing a problem?

Theme

Expected behavior

Should have allowed reasonable rate.

Actual behavior

shop_events_listener-3da45d37.js:1 POST http://127.0.0.1:9292/cart/add.js 429 (Too Many Requests)
window2.fetch @ shop_events_listener-3da45d37.js:1
(anonymous) @ b3918e4e0wbf3ac3cepc5707306mb02b36c6m.js:1
(anonymous) @ liquid-ajax-cart.js:1
A @ liquid-ajax-cart.js:1
w @ liquid-ajax-cart.js:1
x @ liquid-ajax-cart.js:1
(anonymous) @ liquid-ajax-cart.js:1Understand this error
installHook.js:1 Liquid Ajax Cart: Error while performing cart Ajax request
overrideMethod @ installHook.js:1
(anonymous) @ liquid-ajax-cart.js:1
Promise.catch
(anonymous) @ liquid-ajax-cart.js:1
A @ liquid-ajax-cart.js:1
w @ liquid-ajax-cart.js:1
x @ liquid-ajax-cart.js:1
(anonymous) @ liquid-ajax-cart.js:1Understand this error
installHook.js:1 SyntaxError: Unexpected token ‘<’, "<!DOCTYPE "... is not valid JSON overrideMethod @ installHook.js:1 (anonymous) @ liquid-ajax-cart.js:1 Promise.catch (anonymous) @ liquid-ajax-cart.js:1 A @ liquid-ajax-cart.js:1 w @ liquid-ajax-cart.js:1 x @ liquid-ajax-cart.js:1 (anonymous) @ liquid-ajax-cart.js:1Understand this error liquid-ajax-cart.js:1 Uncaught TypeError: Cannot read properties of null (reading 'body') at HTMLDocument. (liquid-ajax-cart.js:1:20396)
at L (liquid-ajax-cart.js:1:3503)
at liquid-ajax-cart.js:1:3093
at

Reproduction steps

Just click add to cart a few times.

Verbose output

shop_events_listener-3da45d37.js:1 POST http://127.0.0.1:9292/cart/add.js 429 (Too Many Requests)
window2.fetch @ shop_events_listener-3da45d37.js:1
(anonymous) @ b3918e4e0wbf3ac3cepc5707306mb02b36c6m.js:1
(anonymous) @ liquid-ajax-cart.js:1
A @ liquid-ajax-cart.js:1
w @ liquid-ajax-cart.js:1
x @ liquid-ajax-cart.js:1
(anonymous) @ liquid-ajax-cart.js:1Understand this error
installHook.js:1 Liquid Ajax Cart: Error while performing cart Ajax request
overrideMethod @ installHook.js:1
(anonymous) @ liquid-ajax-cart.js:1
Promise.catch
(anonymous) @ liquid-ajax-cart.js:1
A @ liquid-ajax-cart.js:1
w @ liquid-ajax-cart.js:1
x @ liquid-ajax-cart.js:1
(anonymous) @ liquid-ajax-cart.js:1Understand this error
installHook.js:1 SyntaxError: Unexpected token ‘<’, "<!DOCTYPE "... is not valid JSON overrideMethod @ installHook.js:1 (anonymous) @ liquid-ajax-cart.js:1 Promise.catch (anonymous) @ liquid-ajax-cart.js:1 A @ liquid-ajax-cart.js:1 w @ liquid-ajax-cart.js:1 x @ liquid-ajax-cart.js:1 (anonymous) @ liquid-ajax-cart.js:1Understand this error liquid-ajax-cart.js:1 Uncaught TypeError: Cannot read properties of null (reading 'body') at HTMLDocument. (liquid-ajax-cart.js:1:20396)
at L (liquid-ajax-cart.js:1:3503)
at liquid-ajax-cart.js:1:3093
at

Operating system

Mac OS Tahoe

CLI version

3.88

Nodejs version

22.21.1

What language and version are you using in your application?

Node

I’m getting the same. Tried different CLI and Node versions with no success

Thanks for reviewing this.

Based on debugging, the issue appears to be local rate‑limiting on the Shopify CLI dev server, not Liquid Ajax Cart itself.

What’s happening

  • Multiple rapid /cart/add.js POST requests are triggered by repeated clicks.

  • The local dev server at http://127.0.0.1:9292 starts returning HTTP 429.

  • When the 429 occurs, the response body is HTML (error page), not JSON.

  • liquid-ajax-cart.js expects JSON and fails with:

    • Unexpected token '<'

    • Followed by Cannot read properties of null (reading 'body')

So the real failure chain is:

429 response (HTML)
→ JSON.parse fails
→ Ajax Cart crashes

Why this is unexpected

On production Shopify storefronts:

  • /cart/add.js tolerates rapid user interaction reasonably well

  • 429 responses are rare and usually return JSON

  • This behavior only reproduces consistently on Shopify CLI local dev

Questions / clarification needed

  1. Is the CLI dev server intentionally rate‑limiting /cart/* endpoints?

  2. Is this rate limit configurable or documented anywhere?

  3. Why does the CLI return HTML instead of JSON for /cart/add.js errors?

  4. Is this behavior expected, or is it a regression in CLI 3.88?

Temporary workarounds (not ideal)

  • Debouncing add to cart clicks in JS

  • Adding manual retry / 429 handling in Ajax Cart

  • Slowing down interaction artificially during development

These workarounds hide the issue but don’t match real storefront behavior.

Suggested fixes

Any of the following would resolve the problem cleanly:

  • Relax rate‑limits for /cart/* routes in CLI dev

  • Return JSON error responses for /cart/add.js consistently

  • Document the rate‑limit so theme/app developers can account for it

Happy to test any proposed fix or provide a minimal reproduction repo if needed.

Thanks.

I mentioned this thread to the author of Liquid Ajax Cart, but I don’t think it’s that library that’s the problem. I’ve used it for years without ever experiencing 422. I think rate limits need to be laxed or returned to what they were before.

Hi all, thanks for reporting this!

We will be addressing this issue in this post:

Please follow that post for updates.

When can we expect to see this resolved? It’s even worse today.

@James_Auble, we have relaxed the throttles slightly. Can you confirm if you’re seeing the issue being worse while running app dev or without it?