{"record":{"id":"a850e28d36d7c2a5","repo":"facebook/react","slug":"532","errorCode":"532","errorMessage":"Attempted to render a Client Component from renderToHTML. This is not supported since it will never hydrate. Only render Server Components with renderToHTML.","messagePattern":"Attempted to render a Client Component from renderToHTML\\. This is not supported since it will never hydrate\\. Only render Server Components with renderToHTML\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/react-server/src/forks/ReactFlightServerConfig.markup.js","lineNumber":69,"sourceCode":"export opaque type ClientReferenceMetadata: any = null;\nexport opaque type ServerReferenceId: string = string;\nexport opaque type ClientReferenceKey: any = string;\n\nconst CLIENT_REFERENCE_TAG = Symbol.for('react.client.reference');\nconst SERVER_REFERENCE_TAG = Symbol.for('react.server.reference');\n\nexport function isClientReference(reference: Object): boolean {\n  return reference.$$typeof === CLIENT_REFERENCE_TAG;\n}\n\nexport function isServerReference(reference: Object): boolean {\n  return reference.$$typeof === SERVER_REFERENCE_TAG;\n}\n\nexport function getClientReferenceKey(\n  reference: ClientReference<any>,\n): ClientReferenceKey {\n  throw new Error(\n    'Attempted to render a Client Component from renderToHTML. ' +\n      'This is not supported since it will never hydrate. ' +\n      'Only render Server Components with renderToHTML.',\n  );\n}\n\nexport function resolveClientReferenceMetadata<T>(\n  config: ClientManifest,\n  clientReference: ClientReference<T>,\n): ClientReferenceMetadata {\n  throw new Error(\n    'Attempted to render a Client Component from renderToHTML. ' +\n      'This is not supported since it will never hydrate. ' +\n      'Only render Server Components with renderToHTML.',\n  );\n}\n\nexport function getServerReferenceId<T>(","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/facebook/react/blob/eafeac097ba51e1eab809c07102126bd5f8e5425/packages/react-server/src/forks/ReactFlightServerConfig.markup.js#L51-L87","documentation":"This fork (ReactFlightServerConfig.markup) implements renderToHTML — static markup generation with no client runtime and no hydration. Client references are meaningless there, so every manifest hook (getClientReferenceKey, resolveClientReferenceMetadata, ...) throws by design. The error fires as soon as the rendered tree contains anything marked 'use client', protecting developers from silently shipping dead interactivity.","triggerScenarios":"Calling renderToHTML on a tree containing a component whose file starts with 'use client'; using the markup fork for static site generation while importing interactive components; reusing an app tree built for the standard Flight stream in a markup-only pipeline.","commonSituations":"Static pre-render pipelines (marketing pages, emails) reusing trees that also contain interactive widgets; migrating from render/prerender to a markup-only fork without splitting the tree.","solutions":["Switch to the standard render/prerender API with a client manifest so client components are emitted as references.","Remove 'use client' from components used in the static-only tree.","Split static pages from interactive routes and render each with the appropriate API."],"exampleFix":"// before\nconst html = await renderToHTML(<InteractiveWidget />, options);\n\n// after\nconst {stream} = render(<InteractiveWidget />, clientManifest);","handlingStrategy":"type-guard","validationCode":"const CLIENT_REFERENCE_TAG = Symbol.for('react.client.reference');\nexport function containsClientReference(node: any, seen = new Set()): boolean {\n  if (node == null || typeof node !== 'object' || seen.has(node)) return false;\n  seen.add(node);\n  if (node.$$typeof === CLIENT_REFERENCE_TAG || node.type?.$$typeof === CLIENT_REFERENCE_TAG) return true;\n  return Object.values(node).some(v => containsClientReference(v, seen));\n}\n// before static rendering:\nif (containsClientReference(tree)) throw new Error('tree contains client components — use render/prerender instead');","typeGuard":"export function isClientReference(v: unknown): boolean {\n  return typeof v === 'object' && v !== null && (v as any).$$typeof === Symbol.for('react.client.reference');\n}","tryCatchPattern":null,"preventionTips":["Reserve renderToHTML for trees verified to be 100% server components.","Walk the tree (or lint imports) for 'use client' before static renders.","Split static pages from interactive routes and render each with the matching API."],"tags":["rendertohtml","client-components","static-generation","server-components"],"backgroundTag":"static-render-unsupported","analyzedSha":"eafeac097ba51e1eab809c07102126bd5f8e5425","analyzedAt":"2026-08-21T22:01:08.818Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}