{"record":{"id":"0d0690f55dcc8306","repo":"facebook/react","slug":"533","errorCode":"533","errorMessage":"Attempted to render a Server Action from renderToHTML. This is not supported since it varies by version of the app. Use a fixed URL for any forms instead.","messagePattern":"Attempted to render a Server Action from renderToHTML\\. This is not supported since it varies by version of the app\\. Use a fixed URL for any forms instead\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/react-server/src/forks/ReactFlightServerConfig.markup.js","lineNumber":91,"sourceCode":"  );\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>(\n  config: ClientManifest,\n  serverReference: ServerReference<T>,\n): ServerReferenceId {\n  throw new Error(\n    'Attempted to render a Server Action from renderToHTML. ' +\n      'This is not supported since it varies by version of the app. ' +\n      'Use a fixed URL for any forms instead.',\n  );\n}\n\nexport function getServerReferenceBoundArguments<T>(\n  config: ClientManifest,\n  serverReference: ServerReference<T>,\n): null | Array<ReactClientValue> {\n  throw new Error(\n    'Attempted to render a Server Action from renderToHTML. ' +\n      'This is not supported since it varies by version of the app. ' +\n      'Use a fixed URL for any forms instead.',\n  );\n}\n\nexport function getServerReferenceLocation<T>(","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/facebook/react/blob/eafeac097ba51e1eab809c07102126bd5f8e5425/packages/react-server/src/forks/ReactFlightServerConfig.markup.js#L73-L109","documentation":"In renderToHTML (static markup) mode, Server Actions cannot be rendered because their generated IDs vary between builds and deployments of the app, so embedding one in immutable HTML would produce a stale action URL. The markup config fork implements getServerReferenceId by throwing instead of assigning an ID.","triggerScenarios":"Rendering a 'use server' function reference with renderToHTML, e.g. <form action={serverAction}> where serverAction is a server reference, causing the Flight server to request its ID.","commonSituations":"Prerendering a page with progressive-enhancement forms that point at server actions; copying a form with an action prop from a streaming RSC app into a static renderToHTML pipeline.","solutions":["Replace the server action in the form with a fixed URL string action (e.g. action=\"/api/submit\") as the error message advises","Remove the server action from the statically rendered tree and invoke it from an interactive client component after hydration","Use a streaming/hydrating renderer (renderToPipeableStream) instead of renderToHTML when server actions must be embedded"],"exampleFix":"// before\n'use server';\nasync function createPost(formData) { /* ... */ }\n// static page:\n<form action={createPost}>...</form> // throws in renderToHTML\n\n// after\n<form method=\"post\" action=\"/api/create-post\">...</form>","handlingStrategy":"validation","validationCode":"// Reject server references before static rendering\nconst isServerReference = (fn: any): boolean =>\n  typeof fn === 'function' &&\n  (fn.$$typeof === Symbol.for('react.server.reference') || Boolean(fn.bind && fn.$$id));\n\nfunction assertFormActionsAreFixed(element) {\n  if (element?.props?.action != null && isServerReference(element.props.action)) {\n    throw new TypeError('Use a fixed URL action, not a server action, in static HTML');\n  }\n}","typeGuard":"const isServerAction = (v: any): boolean =>\n  typeof v === 'function' && v.$$typeof === Symbol.for('react.server.reference');","tryCatchPattern":null,"preventionTips":["Use fixed URL strings for form actions in any statically generated route","Search the codebase for action={ in trees passed to renderToHTML and replace server actions","Keep server actions in hydrating routes only"],"tags":["react-server-components","server-actions","rendertohtml","forms","static-rendering"],"backgroundTag":"server-action-static-render","analyzedSha":"eafeac097ba51e1eab809c07102126bd5f8e5425","analyzedAt":"2026-08-21T22:01:08.818Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}