
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeThis is a frustrating issue, especially when nothing in your code changed! The "Invalid string length" error at query-runner.js:130 with JSON.stringify typically indicates that Gatsby is trying to serialize data that exceeds JavaScript's maximum string size limits. Since the site worked yesterday and broke today without code changes, this almost certainly points to a content change in Sanity.
The UUID dbb54862-d17c-4e11-a1f0-701364e617ac in the error message appears to be Gatsby's internal error ID rather than a Sanity document ID, which is why sanity documents get couldn't find it. This makes debugging tricky because Gatsby isn't directly telling you which document or query is causing the problem.
Since no code changed, someone probably:
1. Check Recent Sanity Content Changes
In your Sanity Studio, look at the document history to see what was modified in the last 24 hours. Look for:
2. Find Your Largest Documents
Run this GROQ query in Vision (your Studio's query tool) to identify potentially problematic documents:
*[!(_id in path("_.**"))] {
_id,
_type,
"approximateSize": length(string::split(string(*), ""))
} | order(approximateSize desc)[0...20]This gives you a rough idea of which documents are largest by character count.
3. Review gatsby-source-sanity Configuration
Check your gatsby-config.js to see if you're pulling more data than necessary:
{
resolve: 'gatsby-source-sanity',
options: {
projectId: 'your-project-id',
dataset: 'your-dataset',
overlayDrafts: false, // Try disabling if you have this enabled
watchMode: false,
}
}4. Increase Node Memory (Temporary Fix)
While you investigate, you might be able to get builds working again by increasing Node's memory allocation:
NODE_OPTIONS="--max-old-space-size=8192" gatsby buildThis isn't a permanent solution but can help you get unblocked while you identify the root cause.
Once you identify the problematic content:
If you're still stuck, try temporarily removing gatsby-source-sanity from your config and rebuilding to confirm that's where the issue originates. Then add it back with a more restrictive configuration to narrow down which content is problematic.
The combination of "worked yesterday, broken today" + "no code changes" makes this almost certainly a content issue rather than a configuration problem. Start with your Sanity Studio's recent history—that's your best bet for finding the culprit quickly.
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store