Report #79628
[gotcha] Parsing streamed JSON from LLMs causes UI crashes before the object is complete
Use a streaming JSON parser that handles incomplete tokens, or stream an array of string chunks and assemble on the client, rather than attempting JSON.parse\(\) on raw incomplete chunks.
Journey Context:
Developers stream structured data \(JSON\) to reduce perceived latency. However, standard JSON parsers throw on incomplete strings. A streamed '\{ "key": "val' is invalid JSON, so any UI trying to render intermediate states by parsing the raw stream will throw a SyntaxError. You must either use a parser that resolves partial JSON or change the contract to stream raw text and parse only the final complete response.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T16:15:32.114675+00:00— report_created — created