remotion-dev/remotion · error · Error
Could not find a tsconfig.json file in your project. Did you
Error message
Could not find a tsconfig.json file in your project. Did you delete it? Create a tsconfig.json in the root of your project. Copy the default file from https://github.com/remotion-dev/template-helloworld/blob/main/tsconfig.json. The root directory is: ${remotionRoot} What it means
Thrown by prepareConfigFile when bundling a TypeScript remotion.config.ts (isJavascript=false) and no tsconfig.json exists at the remotion root. esbuild needs a tsconfig to resolve TS in the config file, and Remotion's project template always ships one, so its absence is treated as a user error.
Source
Thrown at packages/cli/src/load-config.ts:21
import {isMainThread} from 'node:worker_threads';
import {BundlerInternals} from '@remotion/bundler';
export type PreparedConfigFile = {
code: string;
remotionRoot: string;
resolved: string;
};
export const prepareConfigFile = async (
remotionRoot: string,
configFileName: string,
isJavascript: boolean,
): Promise<PreparedConfigFile> => {
const resolved = path.resolve(remotionRoot, configFileName);
const tsconfigJson = path.join(remotionRoot, 'tsconfig.json');
if (!isJavascript && !fs.existsSync(tsconfigJson)) {
throw new Error(
`Could not find a tsconfig.json file in your project. Did you delete it? Create a tsconfig.json in the root of your project. Copy the default file from https://github.com/remotion-dev/template-helloworld/blob/main/tsconfig.json. The root directory is: ${remotionRoot}`,
);
}
const virtualOutfile = 'bundle.js';
const result = await BundlerInternals.esbuild.build({
platform: 'node',
target: 'node16',
bundle: true,
entryPoints: [resolved],
tsconfig: isJavascript ? undefined : tsconfigJson,
absWorkingDir: remotionRoot,
outfile: virtualOutfile,
write: false,
packages: 'external',
});
if (result.errors.length > 0) {
throw new Error(View on GitHub (pinned to 78fe4bb3fd)
Solutions
- Create tsconfig.json in the remotion root. Copy the template from https://github.com/remotion-dev/template-helloworld/blob/main/tsconfig.json.
- If you intentionally use plain JS, rename your config to remotion.config.js and ensure the loader is invoked with isJavascript=true (Remotion auto-detects by extension).
- In a monorepo, ensure remotionRoot points at the directory that contains tsconfig.json, or extend a parent config.
Example fix
// before: remotion.config.ts present, no tsconfig.json
// after: add tsconfig.json in the same root
{
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
"jsx": "react-jsx",
"strict": true
}
} Defensive patterns
Strategy: validation
Validate before calling
import {existsSync} from 'node:fs';
import path from 'node:path';
const ensureTsConfig = (remotionRoot: string, isJavascript: boolean) => {
if (isJavascript) return;
const tsconfig = path.join(remotionRoot, 'tsconfig.json');
if (!existsSync(tsconfig)) {
throw new Error(`Missing ${tsconfig}. Create it from the Remotion template.`);
}
};
ensureTsConfig(remotionRoot, configFile.endsWith('.js')); Type guard
const hasTsConfig = (remotionRoot: string): boolean => existsSync(path.join(remotionRoot, 'tsconfig.json'));
Prevention
- Commit tsconfig.json to the repo so it survives git clean.
- In monorepos, set remotionRoot to the directory containing the tsconfig.
- For JS-only projects, name the config remotion.config.js to bypass tsconfig requirement.
When it happens
Trigger: Loading remotion.config.ts (the default) in a project where tsconfig.json was deleted, renamed, or never created. Running in a JS-only project that nonetheless has a .ts config file.
Common situations: Accidentally deleting tsconfig.json; git clean removing untracked files; starting from a non-TypeScript template then adding remotion.config.ts; monorepo where tsconfig lives in a parent and remotionRoot is set to a subpackage.
Related errors
- Error in remotion.config.ts file: ${result.errors .map((
- setImageSequence accepts a Boolean Value
- outputLocation must be a string but got ${typeof newOutputLo
- Studio server port should be a number. Got ${typeof port} ($
- Caching flag must be a boolean.
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/9b22502d95bc56e7.
Report an issue: GitHub.