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
- Run `npx remotion bundle` (or bundle()) first and pass the exact directory it returns.
- Confirm the resolved path with an absolute path or fs.existsSync before deploying.
- 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
- Always derive bundleDir from the return value of bundle().
- In CI, sequence bundle -> deploy as dependent steps.
- Use absolute paths to avoid cwd-relative resolution surprises.
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
- Could not parse `window.remotion_publicPath` in the bundle i
- The bundle directory ${bundleDir} contains a symbolic link t
- The bundle path ${resolvedBundleDir} is not a directory. Pas
- The bundle directory ${resolvedBundleDir} does not contain a
- The bundle directory ${resolvedBundleDir} does not contain a
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/a73e7096841abab8.
Report an issue: GitHub.