{"record":{"id":"444413139b1d15c1","repo":"remix-run/react-router","slug":"unexpected-payload-type","errorCode":null,"errorMessage":"Unexpected payload type","messagePattern":"Unexpected payload type","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/react-router/lib/rsc/browser.tsx","lineNumber":246,"sourceCode":"                  ),\n                  errors: rerender.errors\n                    ? Object.assign(\n                        {},\n                        globalVar.__reactRouterDataRouter.state.errors,\n                        rerender.errors,\n                      )\n                    : null,\n                },\n              );\n            });\n          }\n        })\n        .catch(() => {}),\n    );\n\n    return payloadPromise.then((payload) => {\n      if (payload.type !== \"action\" && payload.type !== \"redirect\") {\n        throw new Error(\"Unexpected payload type\");\n      }\n\n      return payload.actionResult;\n    });\n  };\n}\n\nfunction createRouterFromPayload({\n  fetchImplementation,\n  createFromReadableStream,\n  getContext,\n  payload,\n}: {\n  payload: RSCPayload;\n  createFromReadableStream: BrowserCreateFromReadableStreamFunction;\n  fetchImplementation: (request: Request) => Promise<Response>;\n  getContext: RouterInit[\"getContext\"] | undefined;\n}): {","sourceCodeStart":228,"sourceCodeEnd":264,"githubUrl":"https://github.com/remix-run/react-router/blob/7aea711dd1ae2bc5a076d13ff17291829690fa74/packages/react-router/lib/rsc/browser.tsx#L228-L264","documentation":"After invoking a server action, the RSC client decodes the returned payload and requires its `type` to be `\"action\"` (with `actionResult`) or `\"redirect\"`. Anything else — typically a `\"render\"` navigation payload or a `\"manifest\"` payload — throws this error. It almost always means the POST was not processed as an action call by the server, so the shape the client got does not match the action protocol.","triggerScenarios":"A proxy or service worker stripping the `rsc-action-id` header, so the server treats the request as a normal navigation and returns a render payload; version skew where an old client sends action ids a new server no longer resolves to actions; custom servers routing RSC POSTs to the wrong handler.","commonSituations":"Reverse proxies (nginx/Cloudflare workers) dropping custom headers; auth layers that redirect POSTs into GET navigations; mid-deploy requests where client and server action manifests disagree.","solutions":["Verify the `rsc-action-id` request header survives every proxy/CDN/service-worker hop and reaches your server.","Rule out version skew: hard reload after deploys, and keep client/server built from the same artifact.","If you have a custom server, ensure requests with `rsc-action-id` are handled by the RSC action pipeline, not the document/SSR pipeline.","Log the received payload `type` temporarily to identify which interceptor is changing the response."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await submitServerAction();\n} catch (e) {\n  if (e instanceof Error && e.message === \"Unexpected payload type\") {\n    window.location.reload(); // typically version skew after a deploy\n  } else {\n    throw e;\n  }\n}","preventionTips":["Preserve the rsc-action-id header across every proxy hop.","Deploy client and server together; prompt reload on version change.","Route rsc-action-id requests to the RSC handler in custom servers."],"tags":["rsc","server-action","payload-type","version-skew"],"backgroundTag":"unexpected-response-type","analyzedSha":"7aea711dd1ae2bc5a076d13ff17291829690fa74","analyzedAt":"2026-08-18T18:04:14.938Z","contentChangedAt":"2026-08-18T18:04:14.938Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}