{"record":{"id":"f1a5cc20d799eee6","repo":"vercel/next.js","slug":"error-serializing-props-returned-from-method","errorCode":null,"errorMessage":"Error serializing props returned from `${method}` in \"${page}\".\nReason: Props must be returned as a plain object from ${method}: `{ props: { ... } }` (received: `${getObjectClassLabel(input)}`).","messagePattern":"Error serializing props returned from `(.+?)` in \"(.+?)\"\\.\nReason: Props must be returned as a plain object from (.+?): `(.+?) \\}` \\(received: `(.+?)`\\)\\.","errorType":"validation","errorClass":"SerializableError","httpStatus":null,"severity":"error","filePath":"packages/next/src/lib/is-serializable-props.ts","lineNumber":24,"sourceCode":"const regexpPlainIdentifier = /^[A-Za-z_$][A-Za-z0-9_$]*$/\n\nexport class SerializableError extends Error {\n  constructor(page: string, method: string, path: string, message: string) {\n    super(\n      path\n        ? `Error serializing \\`${path}\\` returned from \\`${method}\\` in \"${page}\".\\nReason: ${message}`\n        : `Error serializing props returned from \\`${method}\\` in \"${page}\".\\nReason: ${message}`\n    )\n  }\n}\n\nexport 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        }\\`).`","sourceCodeStart":6,"sourceCodeEnd":42,"githubUrl":"https://github.com/vercel/next.js/blob/0eb377541648e63402a47b38fee00a8d0ce8f8f1/packages/next/src/lib/is-serializable-props.ts#L6-L42","documentation":"Error \"Error serializing props returned from `${method}` in \"${page}\".\nReason: Props must be returned as a plain object from ${method}: `{ props: { ... } }` (received: `${getObjectClassLabel(input)}`).\" thrown in vercel/next.js.","triggerScenarios":"getStaticProps/getServerSideProps returns a non-plain-object value.","commonSituations":"Returning a class instance, array, or primitive instead of { props: {...} } from a data fetching method.","solutions":["Return props as a plain object: return { props: { ... } } from the data fetching method."],"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"}