{"record":{"id":"c1a5ab30b947c2f3","repo":"remotion-dev/remotion","slug":"the-bundle-directory-resolvedbundledir-does-not-c1a5ab","errorCode":null,"errorMessage":"The bundle directory ${resolvedBundleDir} does not contain an index.html file at its root.","messagePattern":"The bundle directory (.+?) does not contain an index\\.html file at its root\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/lambda/src/shared/validate-bundle-dir.ts","lineNumber":68,"sourceCode":"\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');\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(","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/lambda/src/shared/validate-bundle-dir.ts#L50-L86","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","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."],"exampleFix":"// before\ndeploySiteFromBundle({bucketName, region, bundleDir: './src'})\n// after\ndeploySiteFromBundle({bucketName, region, bundleDir: './out'})  // produced by `npx remotion bundle`","handlingStrategy":"validation","validationCode":"import fs from 'node:fs'\nif (!fs.existsSync(`${bundleDir}/index.html`) || !fs.statSync(`${bundleDir}/index.html`).isFile()) {\n  throw new Error('Bundle is missing index.html; rebuild with `npx remotion bundle`.')\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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."],"tags":["bundling","filesystem","validation"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}