{"record":{"id":"39f8b701692c8391","repo":"remotion-dev/remotion","slug":"the-bundle-at-resolvedbundledir-is-not-relocata","errorCode":null,"errorMessage":"The bundle at ${resolvedBundleDir} is not relocatable. Rebuild it using Remotion v4.0.497 or newer.","messagePattern":"The bundle at (.+?) is not relocatable\\. Rebuild it using Remotion v4\\.0\\.497 or newer\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/lambda/src/shared/validate-bundle-dir.ts","lineNumber":86,"sourceCode":"\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":68,"sourceCodeEnd":95,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/lambda/src/shared/validate-bundle-dir.ts#L68-L95","documentation":"Thrown by validateBundleDir() when index.html's `window.remotion_publicPath` is present and parseable but is not exactly './'. Lambda deploys require a relocatable bundle (relative public path) so assets resolve correctly once uploaded to S3. This property was introduced in Remotion v4.0.497.","triggerScenarios":"Deploying a bundle produced by a Remotion version older than v4.0.497, or a bundle whose publicPath was set to an absolute URL or a different relative value.","commonSituations":"Upgrading @remotion/lambda but still deploying a stale cached bundle built with an older Remotion; CI cache serving an old bundle; a custom bundling step overriding publicPath.","solutions":["Upgrade @remotion/bundler and all Remotion packages to v4.0.497 or newer and re-run `npx remotion bundle`.","Clear any CI/local bundle cache so a fresh relocatable bundle is produced.","Ensure no custom bundling config sets an absolute publicPath."],"exampleFix":"// before - deploying a bundle from v4.0.400\n// after\n// $ npm i @remotion/bundler@latest @remotion/lambda@latest\n// $ npx remotion bundle\n// then deploySiteFromBundle({bundleDir: '<fresh output dir>'})","handlingStrategy":"validation","validationCode":"import fs from 'node:fs'\nconst html = fs.readFileSync(`${bundleDir}/index.html`, 'utf8')\nconst m = html.match(/window\\.remotion_publicPath\\s*=\\s*(\"(?:[^\"\\\\]|\\\\.)*\")\\s*;/)\nif (!m || JSON.parse(m[1]) !== './') {\n  throw new Error('Bundle is not relocatable. Rebuild with Remotion v4.0.497+.')\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep all Remotion packages on the same recent version.","Bust CI bundle caches when upgrading Remotion so stale bundles are not deployed.","Add a pre-deploy check for publicPath === './'."],"tags":["bundling","version-upgrade","configuration","aws"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}