JSON formatter freezes Chrome with large payloads (>2MB)
Found a reproducible crash. Pasting a JSON payload larger than roughly 2MB causes the formatter to either hang for 10-15 seconds or make the tab completely unresponsive.
Steps to reproduce:
1. Generate a large JSON array (I used a 3MB response from our data pipeline)
2. Paste into the JSON formatter input
3. Click Format (or let auto-format on paste trigger)
Expected: formats with maybe a slight delay
Actual: Chrome shows "Page Unresponsive" dialog after about 15 seconds
Smaller payloads under 1MB are totally fine. Seems to be a threshold somewhere around 1.5-2MB.
Environment: Chrome 124, Windows 11, Zetbit v1.0.1
4 replies
Reproduced this with a 2.5MB export from our test database. Confirmed it freezes Chrome completely. Files under about 1.2MB are fine though — there's clearly a threshold somewhere in between.
This is almost certainly synchronous JSON.parse() blocking the main thread. The tree view especially would choke on deeply nested structures since it builds the DOM synchronously. A streaming parse or Web Worker approach would fix it but it's not trivial to implement.
Workaround for now: if you just need to minify/compress a large payload, paste it and click Minify instead of Format — that seems to handle larger sizes without crashing. Not ideal but gets you something when the formatter chokes.
Thanks for the workaround @brian_null. Would still love a proper fix though — a size warning ("this payload is large, formatting may take a moment") at minimum would set expectations better than a silent freeze.
Sign in to join the discussion.
