{"record":{"id":"3c3510b63522cdca","repo":"facebook/react","slug":"574","errorCode":"574","errorMessage":"Invalid forward reference.","messagePattern":"Invalid forward reference\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/react-server/src/ReactFlightReplyServer.js","lineNumber":1150,"sourceCode":"          bumpArrayCount(referenceArrayRoot, localLength, response);\n        }\n      }\n      // There's no Element nor Debug Info in the ReplyServer so we don't have to check those here.\n      return chunkValue;\n    case BLOCKED:\n      return waitForReference(\n        response,\n        chunk,\n        parentObject,\n        key,\n        referenceArrayRoot,\n        map,\n        path,\n      );\n    case PENDING:\n      // If we don't have the referenced chunk yet, then this must be a forward reference,\n      // which is not allowed.\n      throw new Error('Invalid forward reference.');\n    default:\n      // This is an error. Instead of erroring directly, we're going to encode this on\n      // an initialization handler.\n      if (initializingHandler) {\n        initializingHandler.errored = true;\n        initializingHandler.value = null;\n        initializingHandler.reason = chunk.reason;\n      } else {\n        initializingHandler = {\n          chunk: null,\n          value: null,\n          reason: chunk.reason,\n          deps: 0,\n          errored: true,\n        };\n      }\n      // Placeholder\n      return null as any;","sourceCodeStart":1132,"sourceCodeEnd":1168,"githubUrl":"https://github.com/facebook/react/blob/eafeac097ba51e1eab809c07102126bd5f8e5425/packages/react-server/src/ReactFlightReplyServer.js#L1132-L1168","documentation":"In a reply, every reference must point at data already present - the server does not lazily stream chunks for replies. When getOutlinedModel resolves a reference to a chunk that is still PENDING (its defining field never arrived), React throws 'Invalid forward reference.'","triggerScenarios":"The FormData references id N (e.g. a field value like 'N:props') but the field that defines chunk N is missing, truncated, or was dropped - broken multipart bodies, framework body-size limits cutting off large submissions, or crafted payloads.","commonSituations":"Server action body size limits (for example serverActions.bodySizeLimit) truncating large payloads mid-stream; proxies stripping multipart parts; hand-built submissions from scrapers.","solutions":["Raise or verify the framework's action body-size limit so large submissions are not truncated.","Ensure no middleware or proxy drops or reorders FormData fields.","Catch the decode error and respond 400; do not retry the same payload.","Align React versions on both sides of the boundary."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  const args = await decodeReply(formData);\n} catch (e) {\n  return new Response('Payload incomplete', {status: 400});\n}","preventionTips":["Size the action body limit above your largest legitimate submission so payloads are not truncated.","Verify proxies and middleware forward all multipart parts untouched.","Do not retry a failed submission with the same body; rebuild it from current state.","Log truncated-payload errors distinctly to catch infrastructure issues early."],"tags":["react","server-actions","deserialization","flight-protocol","truncation"],"backgroundTag":"malformed-serialized-payload","analyzedSha":"eafeac097ba51e1eab809c07102126bd5f8e5425","analyzedAt":"2026-08-21T22:01:08.818Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}