{"record":{"id":"c3ea02716ff86e27","repo":"facebook/react","slug":"cannot-read-symbol-exports-only-named-exports-are","errorCode":null,"errorMessage":"Cannot read Symbol exports. Only named exports are supported on a client module imported on the server.","messagePattern":"Cannot read Symbol exports\\. Only named exports are supported on a client module imported on the server\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/react-server-dom-turbopack/src/ReactFlightTurbopackReferences.js","lineNumber":291,"sourceCode":"          function then(resolve, reject: any) {\n            // Expose to React.\n            return Promise.resolve(resolve(proxy));\n          } as any,\n          // If this is not used as a Promise but is treated as a reference to a `.then`\n          // export then we should treat it as a reference to that name.\n          target.$$id + '#then',\n          false,\n        ));\n        return then;\n      } else {\n        // Since typeof .then === 'function' is a feature test we'd continue recursing\n        // indefinitely if we return a function. Instead, we return an object reference\n        // if we check further.\n        return undefined;\n      }\n  }\n  if (typeof name === 'symbol') {\n    throw new Error(\n      'Cannot read Symbol exports. Only named exports are supported on a client module ' +\n        'imported on the server.',\n    );\n  }\n  let cachedReference = target[name];\n  if (!cachedReference) {\n    const reference: ClientReference<any> = registerClientReferenceImpl(\n      function () {\n        throw new Error(\n          // eslint-disable-next-line react-internal/safe-string-coercion\n          `Attempted to call ${String(name)}() from the server but ${String(name)} 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      target.$$id + '#' + name,\n      target.$$async,\n    );","sourceCodeStart":273,"sourceCodeEnd":309,"githubUrl":"https://github.com/facebook/react/blob/eafeac097ba51e1eab809c07102126bd5f8e5425/packages/react-server-dom-turbopack/src/ReactFlightTurbopackReferences.js#L273-L309","documentation":"The client module proxy only supports string-named exports; any symbol-keyed lookup throws. Symbols cannot be serialized across the Flight boundary, so rather than pretend to succeed (and loop forever on feature tests), the proxy rejects symbol access.","triggerScenarios":"Iterating a client export (`for (const x of ClientModule.items)` reads Symbol.iterator), spreading a client reference in server code, or tooling probing symbols (util.inspect, jest/Vitest serializers) on the proxy.","commonSituations":"Shared utility code that iterates/spreads imports which crossed a 'use client' boundary; test snapshots deep-walking client references; logging frameworks inspecting proxies.","solutions":["Convert data to plain serializable values on the server before passing it across","Do the iteration/spreading inside a client component","When logging or serializing, log a marker (id, name) instead of deep-inspecting the reference"],"exampleFix":"// before (server component)\nimport * as Data from './data-client';\nfor (const item of Data.items) {...} // reads Symbol.iterator -> Error\n\n// after\n// pass Data.items to a client component and iterate there:\n// <ItemList items={Data.items} />","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"const CLIENT_REFERENCE = Symbol.for('react.client.reference');\nfunction isClientReference(value) {\n  return value != null && (typeof value === 'object' || typeof value === 'function') && value.$$typeof === CLIENT_REFERENCE;\n}\nfunction safeIterate(value) {\n  if (isClientReference(value)) {\n    throw new Error('Iterate this reference inside a client component instead');\n  }\n  return value[Symbol.iterator]();\n}","tryCatchPattern":null,"preventionTips":["Convert data to plain serializable values before crossing the boundary","Iterate/spread only inside client components","Avoid deep-logging client references; log ids/names"],"tags":["react-server-components","turbopack","client-references","symbol","iteration"],"backgroundTag":"rsc-client-server-boundary","analyzedSha":"eafeac097ba51e1eab809c07102126bd5f8e5425","analyzedAt":"2026-08-21T22:01:08.818Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}