White search icon

JSON formatter freezes Chrome with large payloads (>2MB)

C
codev_mike Lv.4 Regular
7mo ago
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
N
nina_qa Lv.3 Member
7mo ago
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.
J
jake_dev Lv.5 Trusted
7mo ago
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.
B
brian_null Lv.5 Trusted
7mo ago
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.
C
codev_mike Lv.4 Regular
7mo ago
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.
An unhandled error has occurred. Reload 🗙

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.