{"record":{"id":"d4920c0827421acd","repo":"vercel/next.js","slug":"error-serializing-path-returned-from-metho-d4920c","errorCode":null,"errorMessage":"Error serializing `${path}` returned from `${method}` in \"${page}\".\nReason: `undefined` cannot be serialized as JSON. Please use `null` or omit this value.","messagePattern":"Error serializing `(.+?)` returned from `(.+?)` in \"(.+?)\"\\.\nReason: `undefined` cannot be serialized as JSON\\. Please use `null` or omit this value\\.","errorType":"validation","errorClass":"SerializableError","httpStatus":null,"severity":"error","filePath":"packages/next/src/lib/is-serializable-props.ts","lineNumber":71,"sourceCode":"  ): true {\n    const type = typeof value\n    if (\n      // `null` can be serialized, but not `undefined`.\n      value === null ||\n      // n.b. `bigint`, `function`, `symbol`, and `undefined` cannot be\n      // serialized.\n      //\n      // `object` is special-cased below, as it may represent `null`, an Array,\n      // a plain object, a class, et al.\n      type === 'boolean' ||\n      type === 'number' ||\n      type === 'string'\n    ) {\n      return true\n    }\n\n    if (type === 'undefined') {\n      throw new SerializableError(\n        page,\n        method,\n        path,\n        '`undefined` cannot be serialized as JSON. Please use `null` or omit this value.'\n      )\n    }\n\n    if (isPlainObject(value)) {\n      visit(refs, value, path)\n\n      if (\n        Object.entries(value).every(([key, nestedValue]) => {\n          const nextPath = regexpPlainIdentifier.test(key)\n            ? `${path}.${key}`\n            : `${path}[${JSON.stringify(key)}]`\n\n          const newRefs = new Map(refs)\n          return (","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/vercel/next.js/blob/0eb377541648e63402a47b38fee00a8d0ce8f8f1/packages/next/src/lib/is-serializable-props.ts#L53-L89","documentation":"Serialization check in isSerializable while walking props returned from getStaticProps/getServerSideProps: the value at this path is undefined, which JSON serialization drops entirely. Because the page would render with a missing prop rather than fail loudly, Next.js rejects it and asks for null or omission instead.","triggerScenarios":"Props contain an undefined value at a serialized path.","commonSituations":"A field left undefined in getStaticProps/getServerSideProps props; use null or omit it instead.","solutions":["Replace undefined with null or omit the property from the returned props."],"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"}