{"record":{"id":"16b3f283f123a072","repo":"vercel/next.js","slug":"failed-to-parse-json-body-of-filepath-err-a","errorCode":null,"errorMessage":"Failed to parse JSON body of ${filePath}: ${(err as Error).message}","messagePattern":"Failed to parse JSON body of (.+?): (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/next/src/cli/internal/static-routes-info.ts","lineNumber":516,"sourceCode":"        escape = true\n      } else if (ch === quote) {\n        inString = false\n      }\n      continue\n    }\n    if (ch === '\"' || ch === \"'\") {\n      inString = true\n      quote = ch\n    } else if (ch === '{') {\n      depth++\n    } else if (ch === '}') {\n      depth--\n      if (depth === 0) {\n        const body = content.slice(start, i + 1)\n        try {\n          return JSON.parse(body)\n        } catch (err) {\n          throw new Error(\n            `Failed to parse JSON body of ${filePath}: ${(err as Error).message}`\n          )\n        }\n      }\n    }\n  }\n  throw new Error(`Unterminated JSON object in ${filePath}.`)\n}\n\n/**\n * Add a chunk path to the right client-side category. Strips a `?dpl=...`\n * (or any other) query suffix that webpack appends, then dispatches by\n * extension. Returns true if the path looked like a real asset (had an\n * extension we recognize) — used by the webpack `clientModules` walker\n * below to filter out chunk IDs.\n */\nfunction addClientChunk(rawPath: string, sets: FileSets): boolean {\n  // Some manifests append `?dpl=ID` to chunk URLs.","sourceCodeStart":498,"sourceCodeEnd":534,"githubUrl":"https://github.com/vercel/next.js/blob/0eb377541648e63402a47b38fee00a8d0ce8f8f1/packages/next/src/cli/internal/static-routes-info.ts#L498-L534","documentation":"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.","triggerScenarios":"Reading a JSON metadata file for static routes info fails JSON parsing.","commonSituations":"A corrupted or hand-edited routes-manifest or similar JSON file in .next cannot be parsed.","solutions":["Fix the JSON syntax in the referenced routes info file, or delete it so Next.js regenerates it."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0eb377541648e63402a47b38fee00a8d0ce8f8f1","analyzedAt":"2026-08-19T02:10:13.922Z","contentChangedAt":"2026-08-19T02:10:13.922Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}