{"record":{"id":"81a3cad28bba4552","repo":"facebook/react","slug":"failed-to-read-a-rsc-payload-created-by-a-developm","errorCode":null,"errorMessage":"Failed to read a RSC payload created by a development version of React on the server while using a production version on the client. Always use matching versions on the server and the client.","messagePattern":"Failed to read a RSC payload created by a development version of React on the server while using a production version on the client\\. Always use matching versions on the server and the client\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"packages/react-client/src/ReactFlightClient.js","lineNumber":5119,"sourceCode":"      if (__DEV__) {\n        resolveDebugModel(response, id, row);\n        return;\n      }\n      // Fallthrough to share the error with Console entries.\n    }\n    case 74 /* \"J\" */: {\n      if (enableProfilerTimer && enableAsyncDebugInfo) {\n        resolveIOInfo(response, id, row);\n        return;\n      }\n      // Fallthrough to share the error with Console entries.\n    }\n    case 87 /* \"W\" */: {\n      if (__DEV__) {\n        resolveConsoleEntry(response, row);\n        return;\n      }\n      throw new Error(\n        'Failed to read a RSC payload created by a development version of React ' +\n          'on the server while using a production version on the client. Always use ' +\n          'matching versions on the server and the client.',\n      );\n    }\n    case 82 /* \"R\" */: {\n      startReadableStream(response, id, undefined, streamState);\n      return;\n    }\n    // Fallthrough\n    case 114 /* \"r\" */: {\n      startReadableStream(response, id, 'bytes', streamState);\n      return;\n    }\n    // Fallthrough\n    case 88 /* \"X\" */: {\n      startAsyncIterable(response, id, false, streamState);\n      return;","sourceCodeStart":5101,"sourceCodeEnd":5137,"githubUrl":"https://github.com/facebook/react/blob/eafeac097ba51e1eab809c07102126bd5f8e5425/packages/react-client/src/ReactFlightClient.js#L5101-L5137","documentation":"Flight rows of type 'W' are development-only console-log replays that a __DEV__ React server emits alongside the payload. A production client build has the 'W' handler compiled out, so when it meets such a row it throws with the diagnosis: the payload came from a development server while the client runs production, and versions/modes must match. The error is a hard stop because the client cannot parse the rest of a stream containing dev-only rows.","triggerScenarios":"Server bundle built/run with React in development mode (NODE_ENV != production) while the browser runs a production React build, and the client receives a 'W' (or 'J' console-info) row; typically after the server emits console.log during rendering on the server.","commonSituations":"Local dev server (dev mode) being consumed by a production-built client bundle for 'realistic' testing; a prod CDN serving stale dev assets or vice versa after a partial deploy; NODE_ENV set inconsistently between the SSR/RSC process and the client bundler; tooling that serializes payloads with dev React for inspection then decodes with prod React.","solutions":["Run both sides in the same mode: start the server with NODE_ENV=production (with production React), or consume with a dev-mode client build","Deploy server and client from the same CI artifact so the React channel (dev/prod) and version cannot diverge","Verify your bundler did not hardcode process.env.NODE_ENV differently on each side","If you intentionally serialize with dev React (debug tooling), decode with a dev-mode React too, not a production one"],"exampleFix":"# before\n# server started in dev, client bundle built for prod\nNODE_ENV=development node server.js   # emits 'W' rows\n\n# after\nNODE_ENV=production node server.js    # prod React on both ends\n# (or locally: use the dev client bundle against the dev server)","handlingStrategy":"validation","validationCode":"// Boot-time consistency guard\nconst clientDev = process.env.NODE_ENV !== 'production';\n// Expose the server's mode (e.g. via a build-time env or health endpoint)\nif (typeof SERVER_DEV_MODE !== 'undefined' && SERVER_DEV_MODE !== clientDev) {\n  throw new Error('Refusing to consume RSC payload: dev/prod mismatch across the boundary');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ship server and client from the same CI artifact with a single NODE_ENV","Assert matching react/react-dom versions in CI (lockfile check across workspace packages)","Never mix a dev server with production-built client assets","After each deploy, smoke-test a page that server-logs during render - it emits the 'W' rows that break prod clients"],"tags":["rsc","flight","version-mismatch","environment","build-mode"],"backgroundTag":"react-version-mismatch","analyzedSha":"eafeac097ba51e1eab809c07102126bd5f8e5425","analyzedAt":"2026-08-21T22:01:08.818Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}