{"record":{"id":"cb70ec4d06237f31","repo":"facebook/react","slug":"react-dom-static-is-not-supported-in-react-server","errorCode":null,"errorMessage":"react-dom/static is not supported in React Server Components.","messagePattern":"react-dom/static is not supported in React Server Components\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/react-dom/npm/static.react-server.js","lineNumber":3,"sourceCode":"'use strict';\n\nthrow new Error(\n  'react-dom/static is not supported in React Server Components.'\n);\n","sourceCodeStart":1,"sourceCodeEnd":6,"githubUrl":"https://github.com/facebook/react/blob/eafeac097ba51e1eab809c07102126bd5f8e5425/packages/react-dom/npm/static.react-server.js#L1-L6","documentation":"react-dom/static exposes prerender() for producing static HTML outside the RSC runtime. Its react-server condition variant is a stub that throws on import, because inside a Server Components bundle the static-generation pipeline is orchestrated by the framework's build layer, not by user code running in the graph.","triggerScenarios":"import {prerender} from 'react-dom/static' (or react-dom/static.node / static.edge) from a file compiled under the react-server condition, e.g. calling prerender() inside a Server Component or a module it imports.","commonSituations":"Frameworks such as Next.js or Waku own the prerender entry point; user code that calls prerender directly from an App Router server file; build scripts sharing modules with Server Components and importing the static entry.","solutions":["Call prerender() from the framework's designated prerender/SSR entry point, never from Server Component code","Move the prerender call into a plain Node script or build step that does not use the react-server condition","Rely on the framework's static generation (static routes, output: 'export') instead of manual prerender calls"],"exampleFix":"// before (inside a Server Component module)\nimport {prerender} from 'react-dom/static';\nconst {prelude} = await prerender(<Page />);\n\n// after (scripts/prerender.mjs — plain Node, no react-server condition)\nimport {prerender} from 'react-dom/static';\nconst {prelude} = await prerender(<Page />);","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  const {prerender} = await import('react-dom/static');\n  return await prerender(tree);\n} catch (e) {\n  if (e instanceof Error && e.message.includes('not supported in React Server Components')) {\n    // wrong graph — delegate to the framework's prerender entry instead\n    return frameworkPrerender(tree);\n  }\n  throw e;\n}","preventionTips":["Invoke prerender only from build scripts or framework hooks, not Server Components","Document which entry points of your app run under the react-server condition","Keep static-generation logic in the framework layer rather than shared components"],"tags":["react-server-components","react-dom","static-generation","prerender","import-time-error"],"backgroundTag":"unsupported-import-in-rsc","analyzedSha":"eafeac097ba51e1eab809c07102126bd5f8e5425","analyzedAt":"2026-08-21T22:01:08.818Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}