{"record":{"id":"895ae1d4ff118cc5","repo":"facebook/react","slug":"599","errorCode":"599","errorMessage":"Expected an initialized chunk but got an initialized stream chunk instead. This payload may have been submitted by an older version of React.","messagePattern":"Expected an initialized chunk but got an initialized stream chunk instead\\. This payload may have been submitted by an older version of React\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/react-server/src/ReactFlightReplyServer.js","lineNumber":1069,"sourceCode":"  const id = parseInt(path[0], 16);\n  let chunk = getChunk(response, id);\n  switch (chunk.status) {\n    case RESOLVED_MODEL:\n      initializeModelChunk(chunk);\n      // $FlowFixMe[incompatible-type] We just initialized this chunk so it can't be a ResolvedModelChunk anymore.\n      chunk = chunk as Exclude<SomeChunk<T>, ResolvedModelChunk<T>>;\n      break;\n  }\n  // The status might have changed after initialization.\n  switch (chunk.status) {\n    case INITIALIZED:\n      let value = chunk.value;\n      const arrayRootOrController:\n        | null\n        | NestedArrayContext\n        | FlightStreamController = chunk.reason;\n      if (arrayRootOrController !== null && 'error' in arrayRootOrController) {\n        throw new Error(\n          'Expected an initialized chunk but got an initialized stream chunk instead. ' +\n            'This payload may have been submitted by an older version of React.',\n        );\n      }\n      let arrayRoot = arrayRootOrController;\n\n      let localLength: number = 0;\n      const rootArrayContexts = response._rootArrayContexts;\n      for (let i = 1; i < path.length; i++) {\n        const name = path[i];\n        if (\n          typeof value === 'object' &&\n          // $FlowFixMe[invalid-compare] This check is still needed at runtime.\n          value !== null &&\n          (getPrototypeOf(value) === ObjectPrototype ||\n            getPrototypeOf(value) === ArrayPrototype) &&\n          hasOwnProperty.call(value, name)\n        ) {","sourceCodeStart":1051,"sourceCodeEnd":1087,"githubUrl":"https://github.com/facebook/react/blob/eafeac097ba51e1eab809c07102126bd5f8e5425/packages/react-server/src/ReactFlightReplyServer.js#L1051-L1087","documentation":"After a chunk initializes, its reason field should be an array-nesting context or null. If it instead contains an 'error' property it is a FlightStreamController, meaning the chunk was initialized as a stream. Replies written by an older React encode chunks differently, so React throws this explicit version-mismatch error rather than mis-parsing the payload.","triggerScenarios":"A form/action payload serialized by an older react-dom client is decoded by a newer react-server: a long-lived tab or service-worker-cached bundle submits after the server was upgraded.","commonSituations":"Rolling deploys where users keep pages open across releases; service workers or CDN caches serving stale client chunks; mixing canary and stable React packages in one build.","solutions":["Align the React version on the client that produced the payload with the server that decodes it, and release them together.","Bust service worker and CDN caches for client bundles on every deploy.","Catch the error on the action route and respond with a 'please reload' page; the next submission from the fresh bundle succeeds."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  const args = await decodeReply(formData);\n} catch (e) {\n  if (String(e).includes('older version of React')) {\n    // version-skewed client: ask for one reload, then it self-heals\n    return new Response(reloadPageHtml, {status: 409, headers: {'content-type': 'text/html'}});\n  }\n  return new Response('Bad request', {status: 400});\n}","preventionTips":["Release client and server React packages in lockstep with identical versions.","Version cache keys so a new deploy invalidates cached client bundles and RSC payloads.","Skip-serving or update service workers on deploy to avoid stale submitters.","Return a friendly reload prompt when a version-mismatch decode error is caught."],"tags":["react","server-actions","version-mismatch","deserialization"],"backgroundTag":"serialization-version-mismatch","analyzedSha":"eafeac097ba51e1eab809c07102126bd5f8e5425","analyzedAt":"2026-08-21T22:01:08.818Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}