{"record":{"id":"a73e7096841abab8","repo":"remotion-dev/remotion","slug":"the-bundle-directory-resolvedbundledir-does-not","errorCode":null,"errorMessage":"The bundle directory ${resolvedBundleDir} does not exist. Run `npx remotion bundle` or pass a valid `bundleDir`.","messagePattern":"The bundle directory (.+?) does not exist\\. Run `npx remotion bundle` or pass a valid `bundleDir`\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/lambda/src/shared/validate-bundle-dir.ts","lineNumber":55,"sourceCode":"\t\t}\n\n\t\tif (entry.isDirectory()) {\n\t\t\tvalidateNoDirectorySymlinks(entryPath, bundleDir);\n\t\t}\n\t}\n};\n\nexport const validateBundleDir = (bundleDir: unknown): string => {\n\tif (typeof bundleDir !== 'string') {\n\t\tthrow new TypeError(\n\t\t\t`The \\`bundleDir\\` must be a string, but received ${JSON.stringify(bundleDir)}.`,\n\t\t);\n\t}\n\n\tconst resolvedBundleDir = path.resolve(bundleDir);\n\n\tif (!fs.existsSync(resolvedBundleDir)) {\n\t\tthrow new Error(\n\t\t\t`The bundle directory ${resolvedBundleDir} does not exist. Run \\`npx remotion bundle\\` or pass a valid \\`bundleDir\\`.`,\n\t\t);\n\t}\n\n\tif (!fs.statSync(resolvedBundleDir).isDirectory()) {\n\t\tthrow new Error(\n\t\t\t`The bundle path ${resolvedBundleDir} is not a directory. Pass the directory returned by \\`bundle()\\` or created by \\`npx remotion bundle\\`.`,\n\t\t);\n\t}\n\n\tconst indexHtmlPath = path.join(resolvedBundleDir, 'index.html');\n\tif (!fs.existsSync(indexHtmlPath) || !fs.statSync(indexHtmlPath).isFile()) {\n\t\tthrow new Error(\n\t\t\t`The bundle directory ${resolvedBundleDir} does not contain an index.html file at its root.`,\n\t\t);\n\t}\n\n\tconst bundleScriptPath = path.join(resolvedBundleDir, 'bundle.js');","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/lambda/src/shared/validate-bundle-dir.ts#L37-L73","documentation":"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`.","triggerScenarios":"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.","commonSituations":"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/.","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."],"exampleFix":"// before\ndeploySiteFromBundle({bucketName, region, bundleDir: './build'})\n// after\nimport {bundle} from '@remotion/bundler'\nconst bundleDir = await bundle({entryPoint, publicDir})\ndeploySiteFromBundle({bucketName, region, bundleDir})","handlingStrategy":"validation","validationCode":"import fs from 'node:fs'\nif (!fs.existsSync(bundleDir)) {\n  throw new Error(`bundleDir does not exist: ${bundleDir}. Run bundling first.`)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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."],"tags":["bundling","filesystem","validation","configuration"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}