What could cause this?
The frontend is calling JSON.parse on a response whose body begins with Internal S..., so the immediate failure is a contract violation: an upstream request returned plain-text Internal Server Error (or an HTML error page) where the frontend expected JSON. The stack frame is in the compiled Next.js bundle, so it identifies the parsing boundary, not the original backend failure.
Likely causes:
-
An API or proxy returned HTTP 500 with a non-JSON error body; the frontend parses the body without checking
response.okorContent-Type. -
frontend-proxyrouting, upstream connectivity, timeout, or service-discovery failure generated the plain-text response. - A backend dependency failed and its 500 response was passed through unchanged.
- A recent API/error-handling change altered the response format, or the frontend is calling the wrong endpoint/version.
Recommended checks:
-
In browser/network traces, identify the exact request immediately before the parse and record URL, status,
Content-Type, and response body. -
Inspect
frontend-proxyand the target backend for the same request/trace ID; start with HTTP 500s and upstream timeout/reset errors. -
Fix the client boundary to check
response.okand validateContent-Typebefore parsing; expose a structured JSON error envelope for API failures. - Verify proxy error responses are consistently JSON for API routes and that non-API/HTML error pages cannot reach this parser. The issue is likely a secondary frontend symptom; the root cause is the upstream 5xx response.