{"record":{"id":"f11b70c7bf29caf5","repo":"facebook/react","slug":"438-f11b70","errorCode":"438","errorMessage":"An unsupported type was passed to use(): ${String(usable)}","messagePattern":"An unsupported type was passed to use\\(\\): (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/react-server/src/ReactFizzHooks.js","lineNumber":839,"sourceCode":"    // $FlowFixMe[method-unbinding]\n    if (typeof usable.then === 'function') {\n      // This is a thenable.\n      const thenable: Thenable<T> = usable as any;\n      return unwrapThenable(thenable);\n    } else if (usable.$$typeof === REACT_RECOVERABLE_TYPE) {\n      // Create the recoverable error here so its stack captures the component\n      // that passed this value to use(). The internal brand lets the renderer\n      // distinguish it from an Error thrown by application code.\n      const recoverable: ReactRecoverable = usable as any;\n      throw createRecoverableError(recoverable);\n    } else if (usable.$$typeof === REACT_CONTEXT_TYPE) {\n      const context: ReactContext<T> = usable as any;\n      return readContext(context);\n    }\n  }\n\n  // eslint-disable-next-line react-internal/safe-string-coercion\n  throw new Error('An unsupported type was passed to use(): ' + String(usable));\n}\n\nexport function unwrapThenable<T>(thenable: Thenable<T>): T {\n  const index = thenableIndexCounter;\n  thenableIndexCounter += 1;\n  if (thenableState === null) {\n    thenableState = createThenableState();\n  }\n  return trackUsedThenable(thenableState, thenable, index);\n}\n\nexport function readPreviousThenableFromState<T>(): T | void {\n  const index = thenableIndexCounter;\n  thenableIndexCounter += 1;\n  if (thenableState === null) {\n    return undefined;\n  }\n  return readPreviousThenable(thenableState, index);","sourceCodeStart":821,"sourceCodeEnd":857,"githubUrl":"https://github.com/facebook/react/blob/eafeac097ba51e1eab809c07102126bd5f8e5425/packages/react-server/src/ReactFizzHooks.js#L821-L857","documentation":"Fizz's use() accepts only three shapes: a thenable (object with a .then function), an instrumented promise (object with a string status field), and a React context (REACT_CONTEXT_TYPE). Any other value — primitives, plain objects, arrays, functions without .then — falls through to the final branch and throws error code 438 with the coerced value in the message.","triggerScenarios":"use({value: 1}), use(['a', 'b']), use(42), or use('text') inside a component during SSR; passing a context's current value instead of the context object; passing an object that mimics a promise but has no then method.","commonSituations":"Assuming use() works like await for arbitrary values; passing deserialized props or config objects directly to use(); a Promise polyfill or wrapper without .then.","solutions":["Pass only a Promise/thenable or a React context object to use()","In an async Server Component, use plain await for values instead of use()","If you meant to read context, pass the context object returned by createContext, not its current value"],"exampleFix":"// before\nconst settings = use({theme: 'dark'}); // plain object -> throws\n\n// after\nconst settings = use(fetchSettings()); // a Promise/thenable\n// or, inside an async Server Component:\nconst settings = await fetchSettings();","handlingStrategy":"type-guard","validationCode":"if (!isUsable(value)) {\n  throw new TypeError('use() expects a Promise, thenable, or Context');\n}","typeGuard":"function isUsable(value) {\n  if (value !== null && typeof value === 'object') {\n    return (\n      typeof value.then === 'function' ||\n      typeof value.status === 'string' ||\n      value.$$typeof === Symbol.for('react.context')\n    );\n  }\n  return false;\n}","tryCatchPattern":null,"preventionTips":["Type the argument of use() as Promise<T> or Context<T> so the compiler rejects other values","Never pass plain data objects to use(); await them instead in async Server Components"],"tags":["use-hook","invalid-argument","server-components","ssr"],"backgroundTag":"invalid-hook-argument","analyzedSha":"eafeac097ba51e1eab809c07102126bd5f8e5425","analyzedAt":"2026-08-21T22:01:08.818Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}