{"record":{"id":"f01f6ca1e8e07dd3","repo":"facebook/react","slug":"515","errorCode":"515","errorMessage":"Cannot assign to a temporary client reference from a server module.","messagePattern":"Cannot assign to a temporary client reference from a server module\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/react-server/src/ReactFlightServerTemporaryReferences.js","lineNumber":88,"sourceCode":"        // which will be serialized and executed on the client.\n        return receiver;\n      case 'then':\n        // Allow returning a temporary reference from an async function\n        // Unlike regular Client References, a Promise would never have been serialized as\n        // an opaque Temporary Reference, but instead would have been serialized as a\n        // Promise on the server and so doesn't hit this path. So we can assume this wasn't\n        // a Promise on the client.\n        return undefined;\n    }\n    throw new Error(\n      // eslint-disable-next-line react-internal/safe-string-coercion\n      `Cannot access ${String(name)} on the server. ` +\n        'You cannot dot into a temporary client reference from a server component. ' +\n        'You can only pass the value through to the client.',\n    );\n  },\n  set: function () {\n    throw new Error(\n      'Cannot assign to a temporary client reference from a server module.',\n    );\n  },\n};\n\nexport function createTemporaryReference<T>(\n  temporaryReferences: TemporaryReferenceSet,\n  id: string,\n): TemporaryReference<T> {\n  const reference: TemporaryReference<any> = Object.defineProperties(\n    function () {\n      throw new Error(\n        `Attempted to call a temporary Client Reference from the server but it is on the client. ` +\n          `It's not possible to invoke a client function from the server, it can ` +\n          `only be rendered as a Component or passed to props of a Client Component.`,\n      );\n    } as any,\n    {","sourceCodeStart":70,"sourceCodeEnd":106,"githubUrl":"https://github.com/facebook/react/blob/eafeac097ba51e1eab809c07102126bd5f8e5425/packages/react-server/src/ReactFlightServerTemporaryReferences.js#L70-L106","documentation":"The setter half of the temporary-reference proxy: server code attempted to assign a property onto a value that is an opaque client-side handle. Temporary references are pass-through values with no server-side storage, so mutation is meaningless and rejected immediately. This is usually accidental — a helper that caches results on objects, or middleware that decorates its inputs.","triggerScenarios":"fileRef.processed = true; args[0].meta = {...}; any assignment (including ||= / default-filling) to a value that came out of decodeReply's temporaryReferences; third-party libraries that mutate their arguments.","commonSituations":"Memoization helpers stamping objects; middleware annotating request values; validation libraries that normalize inputs in place.","solutions":["Remove mutation of pass-through values; derive new local values instead of decorating them.","Carry any metadata in a separate plain object alongside the reference.","Identity-check values against the temporaryReferences store and treat matches as frozen."],"exampleFix":"// before\nfunction handle(fileRef) { fileRef.seen = true; return passOn(fileRef); }\n\n// after\nfunction handle(fileRef) { const meta = {seen: true}; return passOn(fileRef, meta); }","handlingStrategy":"validation","validationCode":"export function safeAnnotate<T extends object>(\n  v: T, key: string, value: unknown, tempRefs: WeakMap<object, string>,\n): T {\n  if (tempRefs.has(v)) return v; // opaque pass-through — do not mutate\n  (v as any)[key] = value;\n  return v;\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  v.seen = true;\n} catch (e) {\n  if (!String((e as Error)?.message).includes('temporary client reference')) throw e;\n  // else: leave the pass-through value untouched\n}","preventionTips":["Treat action-reply values as immutable pass-throughs.","Keep metadata in separate structures keyed by the reference id.","Identity-check unknown inputs against the temporaryReferences store before decorating them."],"tags":["temporary-references","proxy","mutation","server-components"],"backgroundTag":"rsc-temporary-references","analyzedSha":"eafeac097ba51e1eab809c07102126bd5f8e5425","analyzedAt":"2026-08-21T22:01:08.818Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}