vercel/next.js · error · Error
Failed to parse JSON body of ${filePath}: ${(err as Error).m
Error message
Failed to parse JSON body of ${filePath}: ${(err as Error).message} What it means
Parse failure in parseClientReferenceManifest: it extracts the first balanced {...} JSON object from a generated client reference manifest file and JSON.parse rejected that slice. The original parser message is chained in, so this indicates a corrupted or unexpectedly formatted build artifact at filePath.
Source
Thrown at packages/next/src/cli/internal/static-routes-info.ts:516
escape = true
} else if (ch === quote) {
inString = false
}
continue
}
if (ch === '"' || ch === "'") {
inString = true
quote = ch
} else if (ch === '{') {
depth++
} else if (ch === '}') {
depth--
if (depth === 0) {
const body = content.slice(start, i + 1)
try {
return JSON.parse(body)
} catch (err) {
throw new Error(
`Failed to parse JSON body of ${filePath}: ${(err as Error).message}`
)
}
}
}
}
throw new Error(`Unterminated JSON object in ${filePath}.`)
}
/**
* Add a chunk path to the right client-side category. Strips a `?dpl=...`
* (or any other) query suffix that webpack appends, then dispatches by
* extension. Returns true if the path looked like a real asset (had an
* extension we recognize) — used by the webpack `clientModules` walker
* below to filter out chunk IDs.
*/
function addClientChunk(rawPath: string, sets: FileSets): boolean {
// Some manifests append `?dpl=ID` to chunk URLs.View on GitHub (pinned to 0eb3775416)
Solutions
- Fix the JSON syntax in the referenced routes info file, or delete it so Next.js regenerates it.
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Reading a JSON metadata file for static routes info fails JSON parsing.
Common situations: A corrupted or hand-edited routes-manifest or similar JSON file in .next cannot be parsed.
Understand the failure class
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
AI-assisted analysis of vercel/next.js@0eb3775416 (2026-08-19).
Data as JSON: /api/errors/16b3f283f123a072.
Report an issue: GitHub.