{"record":{"id":"3202eec37e0bfbea","repo":"remotion-dev/remotion","slug":"the-bundle-directory-resolvedbundledir-does-not-3202ee","errorCode":null,"errorMessage":"The bundle directory ${resolvedBundleDir} does not contain a bundle.js file at its root.","messagePattern":"The bundle directory (.+?) does not contain a bundle\\.js file at its root\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/lambda/src/shared/validate-bundle-dir.ts","lineNumber":78,"sourceCode":"\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');\n\tif (\n\t\t!fs.existsSync(bundleScriptPath) ||\n\t\t!fs.statSync(bundleScriptPath).isFile()\n\t) {\n\t\tthrow new Error(\n\t\t\t`The bundle directory ${resolvedBundleDir} does not contain a bundle.js file at its root.`,\n\t\t);\n\t}\n\n\tconst indexHtml = fs.readFileSync(indexHtmlPath, 'utf8');\n\tconst publicPath = getPublicPath(indexHtml);\n\tif (publicPath !== './') {\n\t\tthrow new Error(\n\t\t\t`The bundle at ${resolvedBundleDir} is not relocatable. Rebuild it using Remotion v4.0.497 or newer.`,\n\t\t);\n\t}\n\n\tvalidateNoDirectorySymlinks(resolvedBundleDir, resolvedBundleDir);\n\n\treturn resolvedBundleDir;\n};\n","sourceCodeStart":60,"sourceCodeEnd":95,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/lambda/src/shared/validate-bundle-dir.ts#L60-L95","documentation":"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.","triggerScenarios":"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.","commonSituations":"Partial bundle copy; bundler output customisation; an interrupted bundle write; older bundle format being reused against a newer deploy flow.","solutions":["Re-run `npx remotion bundle` to regenerate a complete bundle with bundle.js at the root.","Confirm `ls bundleDir/bundle.js` resolves to a file before deploying.","If you customised bundler output naming, revert it so the entry is emitted as bundle.js."],"exampleFix":"// before - deploySiteFromBundle against a dir missing bundle.js\n// after - regenerate the bundle\n// $ npx remotion bundle --props=... entry.ts\n// then deploySiteFromBundle({bundleDir: '<output dir>'})","handlingStrategy":"validation","validationCode":"import fs from 'node:fs'\nif (!fs.existsSync(`${bundleDir}/bundle.js`) || !fs.statSync(`${bundleDir}/bundle.js`).isFile()) {\n  throw new Error('Bundle is missing bundle.js; rebuild with `npx remotion bundle`.')\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Regenerate the full bundle rather than patching individual files.","Verify bundle.js presence in a pre-deploy assertion.","Avoid customising bundler output naming that would rename bundle.js."],"tags":["bundling","filesystem","validation"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}