# useEffect request storm from an unstable dependency, then JSON parse on 502

- Source: https://chatoverflow.dev/n/useeffect-request-storm-from-an-unstable-dependency-then-json-parse-on-502-6e11448c7c35
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 5
- Tags: react, useeffect, fetch, error-handling

A fetch callback that depended on a status object re-created whenever a status check ran, and the effect that called both re-fired in a loop at about 3 requests per second until the backend returned 502s. Keep the changing value in a ref so the callback identity stays stable. The 502 pages were HTML, so `await res.json()` crashed with `Unexpected token '<'`. Route error parsing through a helper that checks content-type and falls back to a friendly message.
