{"record":{"id":"b303b7e56af4fddf","repo":"facebook/react","slug":"31-b303b7","errorCode":"31","errorMessage":"Objects are not valid as a React child (found: ${childString === '[object Object]' ? 'object with keys {' + Object.keys(node).join(', ') + '}' : childString}). If you meant to render a collection of children, use an array instead.","messagePattern":"Objects are not valid as a React child \\(found: (.+?)' : childString\\}\\)\\. If you meant to render a collection of children, use an array instead\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/react-server/src/ReactFizzServer.js","lineNumber":3726,"sourceCode":"        childIndex,\n      );\n      return result;\n    }\n\n    if (maybeUsable.$$typeof === REACT_CONTEXT_TYPE) {\n      const context: ReactContext<ReactNodeList> = maybeUsable as any;\n      return renderNodeDestructive(\n        request,\n        task,\n        readContext(context),\n        childIndex,\n      );\n    }\n\n    // $FlowFixMe[method-unbinding]\n    const childString = Object.prototype.toString.call(node);\n\n    throw new Error(\n      `Objects are not valid as a React child (found: ${\n        childString === '[object Object]'\n          ? 'object with keys {' + Object.keys(node).join(', ') + '}'\n          : childString\n      }). ` +\n        'If you meant to render a collection of children, use an array ' +\n        'instead.',\n    );\n  }\n\n  if (typeof node === 'string') {\n    const segment = task.blockedSegment;\n    if (segment === null) {\n      // We assume a text node doesn't have a representation in the replay set,\n      // since it can't postpone. If it does, it'll be left unmatched and error.\n    } else {\n      segment.lastPushedText = pushTextInstance(\n        segment.chunks,","sourceCodeStart":3708,"sourceCodeEnd":3744,"githubUrl":"https://github.com/facebook/react/blob/eafeac097ba51e1eab809c07102126bd5f8e5425/packages/react-server/src/ReactFizzServer.js#L3708-L3744","documentation":"Fizz's renderNodeDestructive accepts strings, numbers, arrays, iterables, React elements, thenables, and contexts as children. A plain object reaches the final branch and throws error code 31; the message reports Object.prototype.toString of the value and, for plain objects, lists its keys.","triggerScenarios":"Rendering {config}, new Date(), a Map or Set, an Error instance, an ORM row, or any class instance directly as a JSX child during SSR.","commonSituations":"Passing server data straight into JSX (API objects, i18n bundles, URLSearchParams); forgetting toISOString()/toString()/join(); children props that unexpectedly contain an object.","solutions":["Convert objects to primitives before rendering: toISOString(), String(...), Array.from(...), or JSON.stringify(...)","Render collections as arrays: Object.entries(obj).map(([k, v]) => ...)","Pass objects as props to child components instead of rendering them as children"],"exampleFix":"// before\n<div>{new Date(post.createdAt)}</div> // renders '[object Date]' branch -> throws\n\n// after\n<div>{new Date(post.createdAt).toISOString()}</div>","handlingStrategy":"validation","validationCode":"function assertRenderableChildren(node) {\n  if (node == null || typeof node === 'string' || typeof node === 'number' || typeof node === 'boolean') return;\n  if (Array.isArray(node)) return node.forEach(assertRenderableChildren);\n  if (typeof node === 'object' && node.$$typeof != null) return; // React element\n  throw new TypeError('Objects are not valid as a React child: ' + Object.prototype.toString.call(node));\n}","typeGuard":"function isRenderableChild(node) {\n  return (\n    node == null ||\n    typeof node === 'string' ||\n    typeof node === 'number' ||\n    typeof node === 'boolean' ||\n    Array.isArray(node) ||\n    (typeof node === 'object' && node.$$typeof != null)\n  );\n}","tryCatchPattern":null,"preventionTips":["Convert dates, Maps, Sets, and plain objects to primitives before putting them in JSX","Type children props as ReactNode so TypeScript rejects object children","Smoke-render server components in dev to catch stray objects early"],"tags":["invalid-child","objects","jsx","ssr"],"backgroundTag":"objects-not-valid-react-child","analyzedSha":"eafeac097ba51e1eab809c07102126bd5f8e5425","analyzedAt":"2026-08-21T22:01:08.818Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}