{"record":{"id":"f03b0c99daf3ef53","repo":"remotion-dev/remotion","slug":"the-bundle-directory-bundledir-contains-a-symbo","errorCode":null,"errorMessage":"The bundle directory ${bundleDir} contains a symbolic link to a directory at ${path.relative(bundleDir, entryPath)}. Directory symbolic links are not supported by `deploySiteFromBundle()`.","messagePattern":"The bundle directory (.+?) contains a symbolic link to a directory at (.+?)\\. Directory symbolic links are not supported by `deploySiteFromBundle\\(\\)`\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/lambda/src/shared/validate-bundle-dir.ts","lineNumber":31,"sourceCode":"\ttry {\n\t\treturn JSON.parse(match[1]);\n\t} catch (error) {\n\t\tthrow new Error(\n\t\t\t'Could not parse `window.remotion_publicPath` in the bundle index.html.',\n\t\t\t{cause: error},\n\t\t);\n\t}\n};\n\nconst validateNoDirectorySymlinks = (\n\tdirectory: string,\n\tbundleDir: string,\n): void => {\n\tfor (const entry of fs.readdirSync(directory, {withFileTypes: true})) {\n\t\tconst entryPath = path.join(directory, entry.name);\n\t\tif (entry.isSymbolicLink()) {\n\t\t\tif (fs.statSync(entryPath).isDirectory()) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`The bundle directory ${bundleDir} contains a symbolic link to a directory at ${path.relative(bundleDir, entryPath)}. Directory symbolic links are not supported by \\`deploySiteFromBundle()\\`.`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tcontinue;\n\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);","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/lambda/src/shared/validate-bundle-dir.ts#L13-L49","documentation":"Thrown by validateNoDirectorySymlinks(), called from validateBundleDir(), when recursing through the bundle directory tree and finding a symbolic link that resolves to a directory. deploySiteFromBundle() uploads flat files and cannot preserve directory symlinks, so any such link is rejected.","triggerScenarios":"The bundleDir (or any subdirectory of it) contains a symlink whose target is a directory; common with node_modules-style links, monorepo workspace links, or manually created shortcuts.","commonSituations":"Bundling a path that includes symlinked node_modules (pnpm/yarn workspaces), symlinked asset folders, or running deploySiteFromBundle against a directory that contains dev conveniences like `assets -> ../shared/assets`.","solutions":["Resolve or copy real directories instead of symlinks before bundling (e.g. dereference with `cp -rL` or `fs.cpSync(..., {recursive: true})`).","Audit the bundle with `find bundleDir -type l -exec test -d {} \\; -print` and remove/replace offending links.","Bundle with a tool that dereferences symlinks so the output tree is fully materialised."],"exampleFix":"# before: deploySiteFromBundle({bundleDir: './out'})  # ./out/assets -> ../shared/assets\n# after: materialise the bundle\n# $ cp -rL out out-flat && deploySiteFromBundle({bundleDir: './out-flat'})","handlingStrategy":"validation","validationCode":"import fs from 'node:fs'\nimport path from 'node:path'\nfunction assertNoDirectorySymlinks(dir) {\n  for (const e of fs.readdirSync(dir, {withFileTypes: true})) {\n    if (!e.isSymbolicLink()) continue\n    if (fs.statSync(path.join(dir, e.name)).isDirectory())\n      throw new Error(`Directory symlink found: ${e.name}`)\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Bundle with a tool that dereferences symlinks, or copy with `cp -rL` before deploy.","Avoid pointing bundleDir at workspace-managed node_modules trees.","Run a pre-deploy symlink audit on the bundle directory."],"tags":["bundling","filesystem","validation","symlinks"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}