remotion-dev/remotion · error · Error
${result.file} was chosen as the entry point (reason = ${res
Error message
${result.file} was chosen as the entry point (reason = ${result.reason}) but it does not exist. What it means
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.
Source
Thrown at packages/cli/src/entry-point.ts:62
remotionRoot: string;
logLevel: LogLevel;
allowDirectory: boolean;
}): {
file: string | null;
remainingArgs: (string | number)[];
reason: FoundReason;
} => {
const result = findEntryPointInner(args, remotionRoot, logLevel);
if (result.file === null) {
return result;
}
if (RenderInternals.isServeUrl(result.file)) {
return result;
}
if (!existsSync(result.file)) {
throw new Error(
`${result.file} was chosen as the entry point (reason = ${result.reason}) but it does not exist.`,
);
}
if (result.isDirectory && !allowDirectory) {
throw new Error(
`${result.file} was chosen as the entry point (reason = ${result.reason}) but it is a directory - it needs to be a file.`,
);
}
return result;
};
const isBundledCode = (p: string) => {
return existsSync(p) && existsSync(path.join(p, 'index.html'));
};
const findEntryPointInner = (View on GitHub (pinned to 78fe4bb3fd)
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.
Example fix
// before $ npx remotion render ./src/wrong.tsx MyComp out.mp4 // after - correct the path $ npx remotion render ./src/index.tsx MyComp out.mp4
Defensive patterns
Strategy: validation
Validate before calling
import {existsSync} from 'node:fs';
import path from 'node:path';
const validateEntryPoint = (entry: string, remotionRoot: string) => {
const resolved =
existsSync(path.resolve(process.cwd(), entry))
? path.resolve(process.cwd(), entry)
: path.resolve(remotionRoot, entry);
if (!existsSync(resolved)) {
throw new Error(`Entry point does not exist: ${resolved}`);
}
return resolved;
};
// call before invoking the CLI render API
validateEntryPoint(userEntry, remotionRoot); Type guard
const isExistingFile = (p: string): boolean => typeof p === 'string' && p.length > 0 && existsSync(p);
Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- ${result.file} was chosen as the entry point (reason = ${res
- The public directory was specified as "${p}", and while this
- The public directory was specified as "${p}", but this folde
- Could not determine version of installed Remotion packages:
- Image format mismatch: ${downloadName} was given as the down
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/33d79d78d9c93222.
Report an issue: GitHub.