remotion-dev/remotion · error · Error

The bundle directory ${resolvedBundleDir} does not contain a

Error message

The bundle directory ${resolvedBundleDir} does not contain a bundle.js file at its root.

What it means

Thrown by validateBundleDir() when the directory contains index.html but is missing bundle.js at its root (missing or not a regular file). bundle.js is the compiled entry chunk the Lambda runtime executes; without it the bundle is incomplete.

Source

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

	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');
	if (
		!fs.existsSync(bundleScriptPath) ||
		!fs.statSync(bundleScriptPath).isFile()
	) {
		throw new Error(
			`The bundle directory ${resolvedBundleDir} does not contain a bundle.js file at its root.`,
		);
	}

	const indexHtml = fs.readFileSync(indexHtmlPath, 'utf8');
	const publicPath = getPublicPath(indexHtml);
	if (publicPath !== './') {
		throw new Error(
			`The bundle at ${resolvedBundleDir} is not relocatable. Rebuild it using Remotion v4.0.497 or newer.`,
		);
	}

	validateNoDirectorySymlinks(resolvedBundleDir, resolvedBundleDir);

	return resolvedBundleDir;
};

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Re-run `npx remotion bundle` to regenerate a complete bundle with bundle.js at the root.
  2. Confirm `ls bundleDir/bundle.js` resolves to a file before deploying.
  3. If you customised bundler output naming, revert it so the entry is emitted as bundle.js.

Example fix

// before - deploySiteFromBundle against a dir missing bundle.js
// after - regenerate the bundle
// $ npx remotion bundle --props=... entry.ts
// then deploySiteFromBundle({bundleDir: '<output dir>'})
Defensive patterns

Strategy: validation

Validate before calling

import fs from 'node:fs'
if (!fs.existsSync(`${bundleDir}/bundle.js`) || !fs.statSync(`${bundleDir}/bundle.js`).isFile()) {
  throw new Error('Bundle is missing bundle.js; rebuild with `npx remotion bundle`.')
}

Prevention

When it happens

Trigger: Passing a directory whose bundle.js was renamed, deleted, or never written; a custom bundler config that changed the chunk filename without updating index.html references.

Common situations: Partial bundle copy; bundler output customisation; an interrupted bundle write; older bundle format being reused against a newer deploy flow.

Related errors


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