facebook/react · critical · Error

Failed to read a RSC payload created by a development versio

Error message

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.

What it means

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.

Source

Thrown at packages/react-client/src/ReactFlightClient.js:5119

      if (__DEV__) {
        resolveDebugModel(response, id, row);
        return;
      }
      // Fallthrough to share the error with Console entries.
    }
    case 74 /* "J" */: {
      if (enableProfilerTimer && enableAsyncDebugInfo) {
        resolveIOInfo(response, id, row);
        return;
      }
      // Fallthrough to share the error with Console entries.
    }
    case 87 /* "W" */: {
      if (__DEV__) {
        resolveConsoleEntry(response, row);
        return;
      }
      throw new Error(
        '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.',
      );
    }
    case 82 /* "R" */: {
      startReadableStream(response, id, undefined, streamState);
      return;
    }
    // Fallthrough
    case 114 /* "r" */: {
      startReadableStream(response, id, 'bytes', streamState);
      return;
    }
    // Fallthrough
    case 88 /* "X" */: {
      startAsyncIterable(response, id, false, streamState);
      return;

View on GitHub (pinned to eafeac097b)

Solutions

  1. 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
  2. Deploy server and client from the same CI artifact so the React channel (dev/prod) and version cannot diverge
  3. Verify your bundler did not hardcode process.env.NODE_ENV differently on each side
  4. If you intentionally serialize with dev React (debug tooling), decode with a dev-mode React too, not a production one

Example fix

# before
# server started in dev, client bundle built for prod
NODE_ENV=development node server.js   # emits 'W' rows

# after
NODE_ENV=production node server.js    # prod React on both ends
# (or locally: use the dev client bundle against the dev server)
Defensive patterns

Strategy: validation

Validate before calling

// Boot-time consistency guard
const clientDev = process.env.NODE_ENV !== 'production';
// Expose the server's mode (e.g. via a build-time env or health endpoint)
if (typeof SERVER_DEV_MODE !== 'undefined' && SERVER_DEV_MODE !== clientDev) {
  throw new Error('Refusing to consume RSC payload: dev/prod mismatch across the boundary');
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of facebook/react@eafeac097b (2026-08-21). Data as JSON: /api/errors/81a3cad28bba4552. Report an issue: GitHub.