{"record":{"id":"5e77ba7d7f07d5da","repo":"remotion-dev/remotion","slug":"you-passed-entrypoint-as-your-entry-point-but","errorCode":null,"errorMessage":"You passed ${entryPoint} as your entry point, but this file does not contain \"registerRoot\". You should use the file that calls registerRoot() as the entry point. To ignore this error, pass \"ignoreRegisterRootWarning\" to bundle(). This error cannot be ignored on the CLI.","messagePattern":"You passed (.+?) as your entry point, but this file does not contain \"registerRoot\"\\. You should use the file that calls registerRoot\\(\\) as the entry point\\. To ignore this error, pass \"ignoreRegisterRootWarning\" to bundle\\(\\)\\. This error cannot be ignored on the CLI\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/bundler/src/bundle.ts","lineNumber":254,"sourceCode":"\t\tconst exists = fs.existsSync(possibleFile);\n\t\tif (exists) {\n\t\t\treturn path.dirname(possibleFile);\n\t\t}\n\n\t\tcurrentDir = path.dirname(currentDir);\n\t}\n\n\treturn null;\n};\n\nconst findClosestPackageJsonFolder = (currentDir: string): string | null => {\n\treturn findClosestFolderWithItem(currentDir, 'package.json');\n};\n\nconst validateEntryPoint = async (entryPoint: string) => {\n\tconst contents = await promises.readFile(entryPoint, 'utf8');\n\tif (!contents.includes('registerRoot')) {\n\t\tthrow new Error(\n\t\t\t[\n\t\t\t\t`You passed ${entryPoint} as your entry point, but this file does not contain \"registerRoot\".`,\n\t\t\t\t'You should use the file that calls registerRoot() as the entry point.',\n\t\t\t\t'To ignore this error, pass \"ignoreRegisterRootWarning\" to bundle().',\n\t\t\t\t'This error cannot be ignored on the CLI.',\n\t\t\t].join(' '),\n\t\t);\n\t}\n};\n\nexport const internalBundle = async (\n\tactualArgs: MandatoryBundleOptions,\n): Promise<string> => {\n\tconst entryPoint = path.resolve(process.cwd(), actualArgs.entryPoint);\n\tconst resolvedRemotionRoot =\n\t\tactualArgs?.rootDir ??\n\t\tfindClosestPackageJsonFolder(entryPoint) ??\n\t\tprocess.cwd();","sourceCodeStart":236,"sourceCodeEnd":272,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/bundler/src/bundle.ts#L236-L272","documentation":"validateEntryPoint reads the entry-point file and checks that its text contains the literal 'registerRoot'. Every Remotion entry point must call registerRoot() to register the root composition; passing a different file (a component, a utils module, the wrong index) is a classic mistake. The check is a substring scan, and it can be bypassed only by passing ignoreRegisterRootWarning (not available on the CLI).","triggerScenarios":"Pointing entryPoint at a <Composition>-only component file, a barrel/index file, or any file that doesn't textually contain 'registerRoot'. File is readable but lacks the call.","commonSituations":"New users pass their Composition component instead of the Root file; code-splitting moved registerRoot elsewhere; renamed the function or referenced it indirectly; pointing at a TypeScript definition file.","solutions":["Point entryPoint at the file that actually calls registerRoot() (usually src/Root.tsx or src/index.ts).","If you register the root indirectly and want to silence the check, pass ignoreRegisterRootWarning: true to bundle() (note: not available on the CLI).","Confirm the file text contains 'registerRoot' literally (grep it).","Make sure the path resolves (a different 'file not found' would surface as an FS error, not this message)."],"exampleFix":"// before\nbundle({entryPoint: './src/MyVideo.tsx'}); // MyVideo.tsx only exports a component\n\n// after\nbundle({entryPoint: './src/index.ts'}); // index.ts contains registerRoot(<Root/>);","handlingStrategy":"validation","validationCode":"import {readFile} from 'node:fs/promises';\nconst assertEntryPointHasRegisterRoot = async (entryPoint: string) => {\n  const src = await readFile(entryPoint, 'utf8');\n  if (!src.includes('registerRoot')) {\n    throw new Error(`${entryPoint} does not contain registerRoot`);\n  }\n};\n// or pass ignoreRegisterRootWarning when you register indirectly:\n// bundle({entryPoint, ignoreRegisterRootWarning: true})","typeGuard":null,"tryCatchPattern":"try {\n  await bundle({entryPoint});\n} catch (err) {\n  if (String(err?.message ?? '').includes('does not contain \"registerRoot\"')) {\n    // point the user at the file that calls registerRoot()\n  } else throw err;\n}","preventionTips":["Standardize on a single entry file (e.g. src/index.ts) that calls registerRoot().","Point entryPoint at that file in all environments (dev, render, tests).","Remember ignoreRegisterRootWarning is unavailable on the CLI — only programmatic.","If you register the root dynamically, keep the literal 'registerRoot' token in the entry file to satisfy the scan."],"tags":["bundler","entry-point","register-root","configuration"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}