{"record":{"id":"209d34d7f8926370","repo":"vercel/next.js","slug":"circular-structure-in-getinitialprops-result-of","errorCode":null,"errorMessage":"Circular structure in \"getInitialProps\" result of page \"${__NEXT_DATA__.page}\". https://nextjs.org/docs/messages/circular-structure","messagePattern":"Circular structure in \"getInitialProps\" result of page \"(.+?)\"\\. https://nextjs\\.org/docs/messages/circular-structure","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/next/src/pages/_document.tsx","lineNumber":896,"sourceCode":"        }\n\n        console.warn(\n          `Warning: data for page \"${__NEXT_DATA__.page}\"${\n            __NEXT_DATA__.page === context.dangerousAsPath\n              ? ''\n              : ` (path \"${context.dangerousAsPath}\")`\n          } is ${prettyBytes(\n            bytes\n          )} which exceeds the threshold of ${prettyBytes(\n            largePageDataBytes\n          )}, this amount of data can reduce performance.\\nSee more info here: https://nextjs.org/docs/messages/large-page-data`\n        )\n      }\n\n      return htmlEscapeJsonString(data)\n    } catch (err) {\n      if (isError(err) && err.message.indexOf('circular structure') !== -1) {\n        throw new Error(\n          `Circular structure in \"getInitialProps\" result of page \"${__NEXT_DATA__.page}\". https://nextjs.org/docs/messages/circular-structure`\n        )\n      }\n      throw err\n    }\n  }\n\n  render() {\n    const {\n      assetPrefix,\n      buildManifest,\n      unstable_runtimeJS,\n      docComponentsRendered,\n      assetQueryString,\n      disableOptimizedLoading,\n      crossOrigin,\n    } = this.context\n    const disableRuntimeJS = unstable_runtimeJS === false","sourceCodeStart":878,"sourceCodeEnd":914,"githubUrl":"https://github.com/vercel/next.js/blob/0eb377541648e63402a47b38fee00a8d0ce8f8f1/packages/next/src/pages/_document.tsx#L878-L914","documentation":"getInlineScriptSource stringifies the page's __NEXT_DATA__ inside a try/catch; when JSON.stringify fails because the getInitialProps return value contains a circular reference, the catch block rethrows this error — data inlined into __NEXT_DATA__ must be JSON-serializable.","triggerScenarios":"Thrown at packages/next/src/pages/_document.tsx:896 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove circular references from the object returned by getInitialProps; it must be JSON-serializable.","Use a serializer-safe subset of the data (e.g. strip class instances, DOM nodes, or back-references) before returning props."],"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"}