{"record":{"id":"33d79d78d9c93222","repo":"remotion-dev/remotion","slug":"result-file-was-chosen-as-the-entry-point-reas","errorCode":null,"errorMessage":"${result.file} was chosen as the entry point (reason = ${result.reason}) but it does not exist.","messagePattern":"(.+?) was chosen as the entry point \\(reason = (.+?)\\) but it does not exist\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cli/src/entry-point.ts","lineNumber":62,"sourceCode":"\tremotionRoot: string;\n\tlogLevel: LogLevel;\n\tallowDirectory: boolean;\n}): {\n\tfile: string | null;\n\tremainingArgs: (string | number)[];\n\treason: FoundReason;\n} => {\n\tconst result = findEntryPointInner(args, remotionRoot, logLevel);\n\tif (result.file === null) {\n\t\treturn result;\n\t}\n\n\tif (RenderInternals.isServeUrl(result.file)) {\n\t\treturn result;\n\t}\n\n\tif (!existsSync(result.file)) {\n\t\tthrow new Error(\n\t\t\t`${result.file} was chosen as the entry point (reason = ${result.reason}) but it does not exist.`,\n\t\t);\n\t}\n\n\tif (result.isDirectory && !allowDirectory) {\n\t\tthrow new Error(\n\t\t\t`${result.file} was chosen as the entry point (reason = ${result.reason}) but it is a directory - it needs to be a file.`,\n\t\t);\n\t}\n\n\treturn result;\n};\n\nconst isBundledCode = (p: string) => {\n\treturn existsSync(p) && existsSync(path.join(p, 'index.html'));\n};\n\nconst findEntryPointInner = (","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/cli/src/entry-point.ts#L44-L80","documentation":"Thrown by findEntryPoint after the entry-point resolver returns a non-null file path that fails an existsSync check. The message includes the resolved absolute path and the FoundReason (e.g. 'argument passed', 'config file', 'common paths') so you can tell which resolution branch picked the bad path. Remotion throws here because every downstream stage (bundling, Studio, rendering) assumes the entry file is on disk.","triggerScenarios":"Passing a positional entry-point argument that resolves in neither cwd nor remotionRoot (the 'argument passed' reason, which is set when the arg exists as a string but no existsSync branch matched). Or a remotion.config.ts entry-point override pointing to a deleted/renamed file ('config file' reason). Or a stale common-path like src/index.tsx that was removed after the resolver cached the candidate list.","commonSituations":"Typo in the entry point path on the CLI; running `npx remotion render` from a subdirectory so the relative path no longer resolves; renaming src/entry.ts to src/index.ts without updating the config; switching branches where the entry file does not exist; passing a path with wrong casing on case-sensitive filesystems.","solutions":["Check that the path printed in the error actually exists on disk: `ls -la <path-from-error>`.","If the reason is 'argument passed', fix the CLI argument or run the command from the directory where the relative path resolves.","If the reason is 'config file', open remotion.config.ts and correct or remove the entry-point override (e.g. Config.setEntryPoint / Config.setVideoImageFormat).","If the reason is 'common paths', create one of the expected entry files (src/index.ts, src/index.tsx, remotion/index.tsx, etc.) or pass the entry point explicitly.","Verify remotionRoot: the CLI searches from the project root containing package.json with remotion installed."],"exampleFix":"// before\n$ npx remotion render ./src/wrong.tsx MyComp out.mp4\n// after - correct the path\n$ npx remotion render ./src/index.tsx MyComp out.mp4","handlingStrategy":"validation","validationCode":"import {existsSync} from 'node:fs';\nimport path from 'node:path';\n\nconst validateEntryPoint = (entry: string, remotionRoot: string) => {\n  const resolved =\n    existsSync(path.resolve(process.cwd(), entry))\n      ? path.resolve(process.cwd(), entry)\n      : path.resolve(remotionRoot, entry);\n  if (!existsSync(resolved)) {\n    throw new Error(`Entry point does not exist: ${resolved}`);\n  }\n  return resolved;\n};\n\n// call before invoking the CLI render API\nvalidateEntryPoint(userEntry, remotionRoot);","typeGuard":"const isExistingFile = (p: string): boolean =>\n  typeof p === 'string' && p.length > 0 && existsSync(p);","tryCatchPattern":null,"preventionTips":["Always resolve entry-point paths against remotionRoot before passing them to the CLI.","In CI, assert the entry file exists as a step before `npx remotion render`.","Avoid hard-coded relative entry paths; derive them from the project root."],"tags":["cli","entry-point","filesystem","config"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}