{"record":{"id":"ed31194a820c4bdb","repo":"facebook/react","slug":"cannot-read-symbol-exports-only-named-exports-are-ed3119","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-unbundled/src/ReactFlightUnbundledReferences.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(\n            name,\n          )} 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,","sourceCodeStart":273,"sourceCodeEnd":309,"githubUrl":"https://github.com/facebook/react/blob/eafeac097ba51e1eab809c07102126bd5f8e5425/packages/react-server-dom-unbundled/src/ReactFlightUnbundledReferences.js#L273-L309","documentation":"The module proxy for a client module can only create references for named (string) exports, because the reference id is built as `moduleId + '#' + name` and the client looks exports up by name. Symbol-keyed exports cannot be represented, so reading any symbol property that is not an internal passthrough (like Symbol.toPrimitive or Symbol.toStringTag) throws with this restriction.","triggerScenarios":"On the server: accessing a symbol-keyed export of a 'use client' module — `mod[Symbol.iterator]`, spreading a namespace import (`{...mod}`), `for...of` over the namespace, or duck-typing probes like `mod[Symbol.asyncIterator]`.","commonSituations":"Iterating or spreading namespace imports of client modules in server components; generic libraries that feature-detect via well-known symbols (iterator, hasInstance) on values that turn out to be client module namespaces; logging utilities that symbolically inspect objects.","solutions":["Import the specific named exports you need instead of using the namespace object.","Keep iterable/duck-typed modules out of 'use client' files if the server must interact with them.","In generic helpers, skip symbol probing for objects marked as client references ($$typeof check)."],"exampleFix":"// before (server component)\nimport * as icons from './icons.client';\nconst names = [...icons];\n\n// after: explicit named imports only\nimport { Star, Heart } from './icons.client';","handlingStrategy":"type-guard","validationCode":"// Skip symbol probes on client namespaces\nfunction isClientModuleNamespace(obj) {\n  return obj != null && obj.$$typeof === Symbol.for('react.client.reference');\n}\nif (!isClientModuleNamespace(mod)) {\n  for (const k of mod) { /* symbol iteration ok */ }\n}","typeGuard":"export function isClientModuleNamespace(value) {\n  return value != null && typeof value === 'object' && value.$$typeof === Symbol.for('react.client.reference');\n}","tryCatchPattern":null,"preventionTips":["Import named exports explicitly instead of using the namespace object.","Do not spread or iterate client module namespaces on the server.","Keep symbol-rich APIs (iterables) out of 'use client' files the server touches."],"tags":["rsc","react-server-components","client-boundary","symbol","namespace-import","proxy","unbundled"],"backgroundTag":"rsc-symbol-export-unsupported","analyzedSha":"eafeac097ba51e1eab809c07102126bd5f8e5425","analyzedAt":"2026-08-21T22:01:08.818Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}