remotion-dev/remotion · error · Error
The bundle directory ${resolvedBundleDir} does not contain a
Error message
The bundle directory ${resolvedBundleDir} does not contain an index.html file at its root. What it means
Thrown by validateBundleDir() when the resolved directory exists but does not contain an index.html file at its root (either missing or not a regular file). Remotion Lambda serves index.html as the bundle entry point, so its absence means this is not a valid Remotion bundle.
Source
Thrown at packages/lambda/src/shared/validate-bundle-dir.ts:68
}
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');
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(View on GitHub (pinned to 78fe4bb3fd)
Solutions
- Regenerate the bundle with `npx remotion bundle` and pass that directory.
- Verify the directory contains index.html at its top level (`ls bundleDir/index.html`).
- If copying the bundle, copy the full tree including index.html.
Example fix
// before
deploySiteFromBundle({bucketName, region, bundleDir: './src'})
// after
deploySiteFromBundle({bucketName, region, bundleDir: './out'}) // produced by `npx remotion bundle` Defensive patterns
Strategy: validation
Validate before calling
import fs from 'node:fs'
if (!fs.existsSync(`${bundleDir}/index.html`) || !fs.statSync(`${bundleDir}/index.html`).isFile()) {
throw new Error('Bundle is missing index.html; rebuild with `npx remotion bundle`.')
} Prevention
- Treat bundles as whole artifacts produced by the bundler; never copy partial trees.
- After producing a bundle, assert the expected file layout before deploy.
- Cache bundles by content hash, not by ad-hoc copies.
When it happens
Trigger: Pointing bundleDir at a directory that is not a Remotion bundle output (e.g. a source folder, a partial copy, or an out/ dir whose index.html was deleted).
Common situations: Copying only part of the bundle; pointing at the project root instead of the bundler output; bundler config that changed the output filename; stale or interrupted bundle write.
Related errors
- Could not parse `window.remotion_publicPath` in the bundle i
- The bundle directory ${bundleDir} contains a symbolic link t
- The bundle directory ${resolvedBundleDir} does not exist. Ru
- The bundle path ${resolvedBundleDir} is not a directory. Pas
- The bundle directory ${resolvedBundleDir} does not contain a
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/c1a5ab30b947c2f3.
Report an issue: GitHub.