{"record":{"id":"a72f2b3c0501ecd4","repo":"facebook/react","slug":"320","errorCode":"320","errorMessage":"Expected ReactFiberErrorDialog.showErrorDialog to be a function.","messagePattern":"Expected ReactFiberErrorDialog\\.showErrorDialog to be a function\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/react-dom/src/client/ReactDOMRootFB.js","lineNumber":79,"sourceCode":"  defaultOnCaughtError,\n} from 'react-reconciler/src/ReactFiberReconciler';\nimport {LegacyRoot} from 'react-reconciler/src/ReactRootTags';\nimport getComponentNameFromType from 'shared/getComponentNameFromType';\n\nimport {\n  current as currentOwner,\n  isRendering,\n} from 'react-reconciler/src/ReactCurrentFiber';\n\nimport assign from 'shared/assign';\n\nimport noop from 'shared/noop';\n\n// Provided by www\nconst ReactFiberErrorDialogWWW = require('ReactFiberErrorDialog');\n\nif (typeof ReactFiberErrorDialogWWW.showErrorDialog !== 'function') {\n  throw new Error(\n    'Expected ReactFiberErrorDialog.showErrorDialog to be a function.',\n  );\n}\n\nfunction wwwOnUncaughtError(\n  error: mixed,\n  errorInfo: {+componentStack?: ?string},\n): void {\n  const componentStack =\n    errorInfo.componentStack != null ? errorInfo.componentStack : '';\n  const logError = ReactFiberErrorDialogWWW.showErrorDialog({\n    errorBoundary: null,\n    error,\n    componentStack,\n  });\n\n  // Allow injected showErrorDialog() to prevent default console.error logging.\n  // This enables renderers like ReactNative to better manage redbox behavior.","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/facebook/react/blob/eafeac097ba51e1eab809c07102126bd5f8e5425/packages/react-dom/src/client/ReactDOMRootFB.js#L61-L97","documentation":"This file is the Meta-internal (www) build of the react-dom client. It requires the internal ReactFiberErrorDialog module — www's error-reporting integration — and enforces at module initialization that ReactFiberErrorDialogWWW.showErrorDialog is a function. Seeing this throw means an FB-conditional build of react-dom is running where 'ReactFiberErrorDialog' does not resolve to www's implementation.","triggerScenarios":"Loading the www variant of react-dom (sources under packages/react-dom/src/client/ReactDOMRootFB.js / ReactDOMClientFB.js) with module resolution that does not provide the www ReactFiberErrorDialog module — a leaked internal artifact, a bad bundler alias, or a Jest moduleNameMapper resolving that specifier to a stub.","commonSituations":"OSS apps accidentally pulling a Meta-internal react-dom artifact via alias or vendored copy; monorepo module maps misconfigured so the conditional 'ReactFiberErrorDialog' specifier misses; packages accidentally built from FB-conditional entry points.","solutions":["Use the public react-dom package (react-dom/client) instead of the www/FB conditional build","Inside the www monorepo, fix the module map so ReactFiberErrorDialog resolves to the real implementation","Audit bundler/Jest aliases for react-dom and ReactFiberErrorDialog and remove stale mappings","Reinstall dependencies to obtain a clean registry build of react-dom"],"exampleFix":"// before (webpack resolve.alias)\n'react-dom': path.resolve(__dirname, 'vendor/www/ReactDOMClientFB.js'),\n\n// after\n'react-dom': false, // let the specifier resolve normally from node_modules","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// Detect an internal-build leak at startup with a clear message\ntry {\n  await import('react-dom/client');\n} catch (e) {\n  if (e instanceof Error && e.message.includes('ReactFiberErrorDialog')) {\n    throw new Error('An internal (www) build of react-dom is installed — replace it with the public react-dom package');\n  }\n  throw e;\n}","preventionTips":["Never alias react-dom to vendored internal/FB builds in OSS projects","Pin react-dom to registry versions in package.json and audit vendored copies","In the www monorepo, verify the module map includes ReactFiberErrorDialog before building"],"tags":["react-dom","meta-internal","www-build","module-resolution","build-config"],"backgroundTag":"internal-build-module-missing","analyzedSha":"eafeac097ba51e1eab809c07102126bd5f8e5425","analyzedAt":"2026-08-21T22:01:08.818Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}