remotion-dev/remotion · error · Error

The bundle directory ${resolvedBundleDir} does not exist. Ru

Error message

The bundle directory ${resolvedBundleDir} does not exist. Run `npx remotion bundle` or pass a valid `bundleDir`.

What it means

Thrown by validateBundleDir() when bundleDir is a string but no filesystem entry exists at the resolved absolute path. It tells you the bundle has not been produced yet (or was produced somewhere else) and points you at `npx remotion bundle`.

Source

Thrown at packages/lambda/src/shared/validate-bundle-dir.ts:55

		}

		if (entry.isDirectory()) {
			validateNoDirectorySymlinks(entryPath, bundleDir);
		}
	}
};

export const validateBundleDir = (bundleDir: unknown): string => {
	if (typeof bundleDir !== 'string') {
		throw new TypeError(
			`The \`bundleDir\` must be a string, but received ${JSON.stringify(bundleDir)}.`,
		);
	}

	const resolvedBundleDir = path.resolve(bundleDir);

	if (!fs.existsSync(resolvedBundleDir)) {
		throw new Error(
			`The bundle directory ${resolvedBundleDir} does not exist. Run \`npx remotion bundle\` or pass a valid \`bundleDir\`.`,
		);
	}

	if (!fs.statSync(resolvedBundleDir).isDirectory()) {
		throw new Error(
			`The bundle path ${resolvedBundleDir} is not a directory. Pass the directory returned by \`bundle()\` or created by \`npx remotion bundle\`.`,
		);
	}

	const indexHtmlPath = path.join(resolvedBundleDir, 'index.html');
	if (!fs.existsSync(indexHtmlPath) || !fs.statSync(indexHtmlPath).isFile()) {
		throw new Error(
			`The bundle directory ${resolvedBundleDir} does not contain an index.html file at its root.`,
		);
	}

	const bundleScriptPath = path.join(resolvedBundleDir, 'bundle.js');

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Run `npx remotion bundle` (or bundle()) first and pass the exact directory it returns.
  2. Confirm the resolved path with an absolute path or fs.existsSync before deploying.
  3. In CI, make the deploy step depend on (and consume the output of) the bundle step.

Example fix

// before
deploySiteFromBundle({bucketName, region, bundleDir: './build'})
// after
import {bundle} from '@remotion/bundler'
const bundleDir = await bundle({entryPoint, publicDir})
deploySiteFromBundle({bucketName, region, bundleDir})
Defensive patterns

Strategy: validation

Validate before calling

import fs from 'node:fs'
if (!fs.existsSync(bundleDir)) {
  throw new Error(`bundleDir does not exist: ${bundleDir}. Run bundling first.`)
}

Prevention

When it happens

Trigger: Passing a bundleDir that does not exist on disk; running deploySiteFromBundle before the bundle step; path typo; relative path resolved from the wrong working directory.

Common situations: CI job that deploys before the bundling job finishes; local script using a relative path that is correct only from a different cwd; bundling to out/ but deploying build/.

Related errors


AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12). Data as JSON: /api/errors/a73e7096841abab8. Report an issue: GitHub.