{"record":{"id":"e38d19acd7073a45","repo":"facebook/react","slug":"514","errorCode":"514","errorMessage":"Cannot access ${String(name)} on the server. You cannot dot into a temporary client reference from a server component. You can only pass the value through to the client.","messagePattern":"Cannot access (.+?) on the server\\. You cannot dot into a temporary client reference from a server component\\. You can only pass the value through to the client\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/react-server/src/ReactFlightServerTemporaryReferences.js","lineNumber":80,"sourceCode":"        // $FlowFixMe[prop-missing]\n        return Object.prototype[Symbol.toPrimitive];\n      case Symbol.toStringTag:\n        // $FlowFixMe[prop-missing]\n        return Object.prototype[Symbol.toStringTag];\n      case 'Provider':\n        // Context.Provider === Context in React, so return the same reference.\n        // This allows server components to render <ClientContext.Provider>\n        // 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(","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/facebook/react/blob/eafeac097ba51e1eab809c07102126bd5f8e5425/packages/react-server/src/ReactFlightServerTemporaryReferences.js#L62-L98","documentation":"On the server, temporary references are Proxy objects that let opaque client-held values (a File from a form, a client-created object) be passed back toward the client untouched. The proxy's get trap permits only a Context Provider identity check and 'then' (so async functions may return the value); reading any other property means the server is trying to use the value, which it cannot, so the trap throws naming the accessed property.","triggerScenarios":"Inside a Server Component or action: const {file} = args; file.name — any property read or destructuring on a temporary reference; for...in, spread, or logging with util.inspect/console.dir over a temp ref (inspectors read properties).","commonSituations":"Trying to inspect an uploaded file's name/size server-side after decoding an action reply; logging decoded action arguments wholesale; passing temp refs through feature-detecting utility code.","solutions":["Do not read or destructure the value on the server — pass it through to a Client Component prop.","If file metadata is needed server-side, read the actual File entry from the original FormData instead of the temp ref.","Exclude temporary references from logging/serialization; log only their identity or id key."],"exampleFix":"// before — Server Component reads the value\nfunction Files({fileRef}) { return <p>{fileRef.name}</p>; }\n\n// after — the client reads it\nfunction Files({fileRef}) { return <FileMeta fileRef={fileRef} />; }\n// FileMeta.tsx\n'use client';\nexport function FileMeta({fileRef}) { return <p>{fileRef.name}</p>; }","handlingStrategy":"try-catch","validationCode":"// Track which decoded values are temporary references by identity BEFORE touching them.\nconst tempRefs = new WeakMap<object, string>();\nconst args = await decodeReply(formData, {temporaryReferences: tempRefs});\nconst opaque = new Set(args.filter(a => typeof a === 'object' && a !== null && tempRefs.has(a)));","typeGuard":"export function isTemporaryReference(v: unknown, store: WeakMap<object, string>): boolean {\n  return typeof v === 'object' && v !== null && store.has(v); // WeakMap.has performs no property access on the proxy\n}","tryCatchPattern":"try {\n  return fileRef.name;\n} catch (e) {\n  if (String((e as Error)?.message).startsWith('Cannot access')) {\n    return undefined; // treat as opaque, pass through untouched\n  }\n  throw e;\n}","preventionTips":["Treat decoded action values you did not create as opaque until identity-checked against the store.","Keep the temporaryReferences store around so store.has(v) can classify values.","Never log raw action args with util.inspect/console.dir on the server."],"tags":["temporary-references","proxy","server-components","props"],"backgroundTag":"rsc-temporary-references","analyzedSha":"eafeac097ba51e1eab809c07102126bd5f8e5425","analyzedAt":"2026-08-21T22:01:08.818Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}