{"record":{"id":"5b99843565eb6743","repo":"facebook/react","slug":"526-5b9984","errorCode":"526","errorMessage":"Could not reference an opaque temporary reference. This is likely due to misconfiguring the temporaryReferences options on the server.","messagePattern":"Could not reference an opaque temporary reference\\. This is likely due to misconfiguring the temporaryReferences options on the server\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/react-server/src/ReactFlightServer.js","lineNumber":4261,"sourceCode":"    if (request.temporaryReferences !== undefined) {\n      const tempRef = resolveTemporaryReference(\n        request.temporaryReferences,\n        value,\n      );\n      if (tempRef !== undefined) {\n        return serializeTemporaryReference(request, tempRef);\n      }\n    }\n\n    if (enableTaint) {\n      const tainted = TaintRegistryObjects.get(value);\n      if (tainted !== undefined) {\n        throwTaintViolation(tainted);\n      }\n    }\n\n    if (isOpaqueTemporaryReference(value)) {\n      throw new Error(\n        'Could not reference an opaque temporary reference. ' +\n          'This is likely due to misconfiguring the temporaryReferences options ' +\n          'on the server.',\n      );\n    } else if (/^on[A-Z]/.test(parentPropertyName)) {\n      throw new Error(\n        'Event handlers cannot be passed to Client Component props.' +\n          describeObjectForErrorMessage(parent, parentPropertyName) +\n          '\\nIf you need interactivity, consider converting part of this to a Client Component.',\n      );\n    } else if (\n      __DEV__ &&\n      (jsxChildrenParents.has(parent) ||\n        (jsxPropsParents.has(parent) && parentPropertyName === 'children'))\n    ) {\n      const componentName = value.displayName || value.name || 'Component';\n      throw new Error(\n        'Functions are not valid as a child of Client Components. This may happen if ' +","sourceCodeStart":4243,"sourceCodeEnd":4279,"githubUrl":"https://github.com/facebook/react/blob/eafeac097ba51e1eab809c07102126bd5f8e5425/packages/react-server/src/ReactFlightServer.js#L4243-L4279","documentation":"The serialization-side mirror of the reply error with the same text: the model being rendered contains a value created by createTemporaryReference (an opaque one-request handle, e.g. a File or client-held value from a decoded action reply), but the current render request was not configured with a temporaryReferences store. Without the store the serializer cannot map the wrapper back to its id, so it refuses rather than emit an unresolvable value.","triggerScenarios":"Calling render()/prerender() on a tree that includes a temporary reference obtained from decodeReply(..., {temporaryReferences}) while the render options omit temporaryReferences; forwarding decoded action args into a follow-up server render without threading the same store.","commonSituations":"Re-rendering after a server action in a custom framework that builds a new request per render; passing decoded action arguments (which contain File handles) into optimistic-UI re-renders; partial adoption of the temporaryReferences API.","solutions":["Pass the same temporaryReferences store you gave decodeReply as an option to render/prerender.","If the value must outlive the request, materialize it first (read the File, persist the data) and pass the result.","Audit custom request-creation code to forward the temporaryReferences option end to end."],"exampleFix":"// before\nconst temporaryReferences = new WeakMap();\nconst args = await decodeReply(formData, {temporaryReferences});\nconst {stream} = render(<App actionArgs={args} />, manifest);\n\n// after\nconst temporaryReferences = new WeakMap();\nconst args = await decodeReply(formData, {temporaryReferences});\nconst {stream} = render(<App actionArgs={args} />, manifest, {temporaryReferences});","handlingStrategy":"validation","validationCode":"// Identity check against the decode store — Map.has never touches the proxy.\nexport function argsContainTemporaryReferences(\n  args: unknown[],\n  temporaryReferences: WeakMap<object, string>,\n): boolean {\n  return args.some(a => typeof a === 'object' && a !== null && temporaryReferences.has(a));\n}\n\nif (argsContainTemporaryReferences(args, temporaryReferences)) {\n  render(tree, manifest, {...opts, temporaryReferences});\n}","typeGuard":"export function isTemporaryReference(v: unknown, store: WeakMap<object, string>): boolean {\n  return typeof v === 'object' && v !== null && store.has(v);\n}","tryCatchPattern":"try {\n  render(tree, manifest, opts);\n} catch (e) {\n  if (String((e as Error)?.message).includes('opaque temporary reference')) {\n    return failRequest('temporary references were not threaded into this render');\n  }\n  throw e;\n}","preventionTips":["Create the temporaryReferences store once per request and pass it to both decodeReply and render/prerender.","Materialize temp-ref values (e.g. read uploaded files) when they must outlive the request."],"tags":["server-components","temporary-references","serialization","server-actions"],"backgroundTag":"rsc-temporary-references","analyzedSha":"eafeac097ba51e1eab809c07102126bd5f8e5425","analyzedAt":"2026-08-21T22:01:08.818Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}