{"record":{"id":"d2fe8049c6c66e58","repo":"remotion-dev/remotion","slug":"folder-name-can-only-contain-a-z-a-z-0-9-and","errorCode":null,"errorMessage":"Folder name can only contain a-z, A-Z, 0-9 and -. You passed ${name}","messagePattern":"Folder name can only contain a-z, A-Z, 0-9 and -\\. You passed (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/src/validation/validate-folder-name.ts","lineNumber":17,"sourceCode":"const getRegex = () => /^([a-zA-Z0-9-\\u4E00-\\u9FFF])+$/g;\n\nexport const isFolderNameValid = (name: string) => name.match(getRegex());\n\nexport const validateFolderName = (name: string | null) => {\n\tif (name === undefined || name === null) {\n\t\tthrow new TypeError('You must pass a name to a <Folder />.');\n\t}\n\n\tif (typeof name !== 'string') {\n\t\tthrow new TypeError(\n\t\t\t`The \"name\" you pass into <Folder /> must be a string. Got: ${typeof name}`,\n\t\t);\n\t}\n\n\tif (!isFolderNameValid(name)) {\n\t\tthrow new Error(\n\t\t\t`Folder name can only contain a-z, A-Z, 0-9 and -. You passed ${name}`,\n\t\t);\n\t}\n};\n\nexport const invalidFolderNameErrorMessage = `Folder name must match ${String(\n\tgetRegex(),\n)}`;\n","sourceCodeStart":1,"sourceCodeEnd":26,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/core/src/validation/validate-folder-name.ts#L1-L26","documentation":"`validateFolderName` requires the name to match `/^([a-zA-Z0-9-\\u4E00-\\u9FFF])+$/g` — ASCII letters, digits, hyphen, and CJK Unified Ideographs (the message text omits CJK, but the regex allows U+4E00–U+9FFF). Spaces, underscores, dots, slashes, and most punctuation are rejected.","triggerScenarios":"Naming a `<Folder>` with spaces, underscores (`my_folder`), dots (`v1.2`), slashes (`a/b`), or other punctuation; using emoji or non-CJK Unicode.","commonSituations":"Trying to encode folder hierarchy with `/` (use nested `<Folder>` instead); snake_case habit; embedding version numbers with dots; nested paths copied into a single name.","solutions":["Use kebab-case: only a-z, 0-9, hyphen (e.g. `'my-folder'`).","For hierarchy, nest `<Folder>` components rather than using `/`.","Sanitize dynamic names by stripping disallowed characters."],"exampleFix":"// before\n<Folder name=\"my_folder/v2\">...</Folder>\n// after\n<Folder name=\"my-folder\">\n  <Folder name=\"v2\">...</Folder>\n</Folder>","handlingStrategy":"validation","validationCode":"const NAME_RE = /^([a-zA-Z0-9-\\u4E00-\\u9FFF])+$/g;\nif (!NAME_RE.test(name)) { throw new Error('Invalid folder name: ' + name); }","typeGuard":"const isFolderNameValid = (n) => /^([a-zA-Z0-9-\\u4E00-\\u9FFF])+$/g.test(n);","tryCatchPattern":null,"preventionTips":["Use kebab-case folder names.","Nest <Folder> for hierarchy instead of using slashes.","Underscore and dot are NOT allowed in folder names.","Sanitize dynamically-sourced folder names before rendering."],"tags":["validation","folder","naming","regex","url-safe"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}