{"record":{"id":"0bf9380288b40eb7","repo":"vercel/next.js","slug":"error-serializing-path-returned-from-metho","errorCode":null,"errorMessage":"Error serializing `${path}` returned from `${method}` in \"${page}\".\nReason: Circular references cannot be expressed in JSON (references: `${visited.get(value) || '(self)'}`).","messagePattern":"Error serializing `(.+?)` returned from `(.+?)` in \"(.+?)\"\\.\nReason: Circular references cannot be expressed in JSON \\(references: `(.+?)`\\)\\.","errorType":"validation","errorClass":"SerializableError","httpStatus":null,"severity":"error","filePath":"packages/next/src/lib/is-serializable-props.ts","lineNumber":36,"sourceCode":"export function isSerializableProps(\n  page: string,\n  method: string,\n  input: any\n): true {\n  if (!isPlainObject(input)) {\n    throw new SerializableError(\n      page,\n      method,\n      '',\n      `Props must be returned as a plain object from ${method}: \\`{ props: { ... } }\\` (received: \\`${getObjectClassLabel(\n        input\n      )}\\`).`\n    )\n  }\n\n  function visit(visited: Map<any, string>, value: any, path: string) {\n    if (visited.has(value)) {\n      throw new SerializableError(\n        page,\n        method,\n        path,\n        `Circular references cannot be expressed in JSON (references: \\`${\n          visited.get(value) || '(self)'\n        }\\`).`\n      )\n    }\n\n    visited.set(value, path)\n  }\n\n  function isSerializable(\n    refs: Map<any, string>,\n    value: any,\n    path: string\n  ): true {\n    const type = typeof value","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/vercel/next.js/blob/0eb377541648e63402a47b38fee00a8d0ce8f8f1/packages/next/src/lib/is-serializable-props.ts#L18-L54","documentation":"Error \"Error serializing `${path}` returned from `${method}` in \"${page}\".\nReason: Circular references cannot be expressed in JSON (references: `${visited.get(value) || '(self)'}`).\" thrown in vercel/next.js.","triggerScenarios":"Props returned from a data fetching method contain a circular reference.","commonSituations":"An object graph with cycles is returned from getStaticProps/getServerSideProps and cannot be serialized to JSON.","solutions":["Remove the circular reference from the returned props; break the cycle or exclude the self-referencing value."],"exampleFix":null,"handlingStrategy":"validation","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-23T08:17:48.524Z"}