{"record":{"id":"c4d0f4ad9e29adf8","repo":"vercel/next.js","slug":"unterminated-json-object-in-filepath","errorCode":null,"errorMessage":"Unterminated JSON object in ${filePath}.","messagePattern":"Unterminated JSON object in (.+?)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/next/src/cli/internal/static-routes-info.ts","lineNumber":523,"sourceCode":"      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.\n  const cleaned = stripNextPrefix(rawPath).split('?')[0]\n  if (cleaned.endsWith('.map')) sets.clientMaps.add(cleaned)\n  else if (cleaned.endsWith('.css')) sets.clientCss.add(cleaned)\n  else if (cleaned.endsWith('.js')) sets.clientJs.add(cleaned)\n  else return false\n  return true\n}","sourceCodeStart":505,"sourceCodeEnd":541,"githubUrl":"https://github.com/vercel/next.js/blob/0eb377541648e63402a47b38fee00a8d0ce8f8f1/packages/next/src/cli/internal/static-routes-info.ts#L505-L541","documentation":"Structural parse failure in parseClientReferenceManifest: the brace-depth scanner reached end-of-file without ever closing the top-level object it opened. This means the manifest file at filePath is truncated or malformed, as opposed to containing invalid JSON inside a complete object.","triggerScenarios":"A JSON object in a static routes info file is truncated or unterminated.","commonSituations":"The build output JSON file was partially written or corrupted on disk.","solutions":["The JSON file is truncated; delete the file and let Next.js regenerate it on the next build."],"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"}