{"record":{"id":"e20fb1850eee5c6d","repo":"remotion-dev/remotion","slug":"could-not-find-react-dom-package-did-you-instal","errorCode":null,"errorMessage":"Could not find \"react-dom\" package. Did you install it?","messagePattern":"Could not find \"react-dom\" package\\. Did you install it\\?","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"packages/bundler/src/shared-bundler-config.ts","lineNumber":9,"sourceCode":"import {createHash} from 'node:crypto';\nimport path from 'node:path';\nimport ReactDOM from 'react-dom';\nimport {NoReactInternals} from 'remotion/no-react';\nimport {jsonStringifyWithCircularReferences} from './stringify-with-circular-references';\nimport {getWebpackCacheName} from './webpack-cache';\n\nif (!ReactDOM?.version) {\n\tthrow new Error('Could not find \"react-dom\" package. Did you install it?');\n}\n\nconst reactDomVersion = ReactDOM.version.split('.')[0];\nif (reactDomVersion === '0') {\n\tthrow new Error(\n\t\t`Version ${reactDomVersion} of \"react-dom\" is not supported by Remotion`,\n\t);\n}\n\nexport const shouldUseReactDomClient =\n\tNoReactInternals.ENABLE_V5_BREAKING_CHANGES\n\t\t? true\n\t\t: parseInt(reactDomVersion, 10) >= 18;\n\nexport const getResolveConfig = () => ({\n\textensions: ['.ts', '.tsx', '.web.js', '.js', '.jsx', '.mjs', '.cjs'],\n\talias: {\n\t\t// Only one version of react","sourceCodeStart":1,"sourceCodeEnd":27,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/bundler/src/shared-bundler-config.ts#L1-L27","documentation":"shared-bundler-config imports react-dom at module load and checks that ReactDOM.version is truthy. If react-dom is not installed, fails to resolve, or resolves to a stub whose version is falsy, this throws at import time — before any bundling begins. It is a hard dependency gate.","triggerScenarios":"Importing anything from the bundler package when react-dom is absent from node_modules, hoisted away in a monorepo, or shadowed by an alias/stub that has no version export.","commonSituations":"Fresh project that installed @remotion/* but forgot react-dom; monorepo hoisting leaving react-dom only in a sibling workspace; an npm/yarn override or resolve alias pointing react-dom at something else; broken partial install.","solutions":["Install react-dom (and react) at the correct version: bun add react react-dom (or npm/yarn equivalent).","Confirm the version is supported by Remotion (18.x or 19.x).","Remove any resolve alias/override that redirects react-dom.","In a monorepo, ensure react-dom resolves from the workspace that runs the bundler (check hoisting / add as an explicit dep)."],"exampleFix":"// before: react-dom not installed -> bundler import throws\n\n// after\n// package.json\n// \"dependencies\": { \"react\": \"^19.0.0\", \"react-dom\": \"^19.0.0\", \"@remotion/bundler\": \"...\" }\n// then: bun install","handlingStrategy":"validation","validationCode":"import {createRequire} from 'node:module';\nconst require = createRequire(import.meta.url);\nconst assertReactDomInstalled = () => {\n  let pkg: {version?: string};\n  try {\n    pkg = require('react-dom/package.json');\n  } catch {\n    throw new Error('react-dom is not installed. Run: bun add react react-dom');\n  }\n  if (!pkg.version || pkg.version.startsWith('0.')) {\n    throw new Error(`Unsupported react-dom version: ${pkg.version}`);\n  }\n};\n// run before importing anything from @remotion/bundler","typeGuard":"const hasSupportedReactDom = (): boolean => {\n  try {\n    const v = require('react-dom/package.json').version as string | undefined;\n    return !!v && !v.startsWith('0.');\n  } catch {\n    return false;\n  }\n};","tryCatchPattern":null,"preventionTips":["Always install react and react-dom alongside Remotion packages.","In monorepos, declare react-dom as an explicit dependency in the workspace that bundles.","Avoid resolve aliases that redirect react-dom.","After a fresh clone, run install before invoking the bundler."],"tags":["bundler","react-dom","dependencies","install","module-load"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}