{"record":{"id":"77bb915de82f5bd0","repo":"remotion-dev/remotion","slug":"composition-id-can-only-contain-a-z-a-z-0-9-cjk","errorCode":null,"errorMessage":"Composition id can only contain a-z, A-Z, 0-9, CJK characters and -. You passed ${id}","messagePattern":"Composition id can only contain a-z, A-Z, 0-9, CJK characters and -\\. You passed (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/src/validation/validate-composition-id.ts","lineNumber":7,"sourceCode":"const getRegex = () => /^([a-zA-Z0-9-\\u4E00-\\u9FFF])+$/g;\n\nexport const isCompositionIdValid = (id: string) => id.match(getRegex());\n\nexport const validateCompositionId = (id: string) => {\n\tif (!isCompositionIdValid(id)) {\n\t\tthrow new Error(\n\t\t\t`Composition id can only contain a-z, A-Z, 0-9, CJK characters and -. You passed ${id}`,\n\t\t);\n\t}\n};\n\nexport const invalidCompositionErrorMessage = `Composition ID must match ${String(\n\tgetRegex(),\n)}`;\n","sourceCodeStart":1,"sourceCodeEnd":16,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/core/src/validation/validate-composition-id.ts#L1-L16","documentation":"A `<Composition>` id must match `/^([a-zA-Z0-9-\\u4E00-\\u9FFF])+$/g` — ASCII letters, digits, hyphen, and CJK Unified Ideographs (U+4E00–U+9FFF) only. `validateCompositionId` runs inside `<Composition>` registration and throws for any other character. The id is used as a URL/path segment, so it must be URL-safe and stable.","triggerScenarios":"Registering a `<Composition id=\"...\">` whose value contains spaces, underscores, dots, slashes, colons, emoji, or any non-ASCII character outside the CJK Unified Ideographs block; e.g. `'my_comp'`, `'video.mp4'`, `'a/b'`, `'héllo'` (Latin diacritic outside range).","commonSituations":"Using snake_case or kebab.with.dots ids out of habit; embedding file extensions; trying to encode a folder path with `/`; copy-pasting an id with a trailing space; using accented Latin characters.","solutions":["Switch to kebab-case using only a-z, 0-9 and hyphen (e.g. `'my-comp'`).","Remove file extensions, spaces, and slashes from the id.","For nesting, use `<Folder>` instead of `/` in the id.","Strip/replace disallowed characters programmatically before registering."],"exampleFix":"// before\n<Composition id=\"my_comp.v2\" ... />\n// after\n<Composition id=\"my-comp-v2\" ... />","handlingStrategy":"validation","validationCode":"const ID_RE = /^([a-zA-Z0-9-\\u4E00-\\u9FFF])+$/g;\nfunction assertCompositionId(id) {\n  ID_RE.lastIndex = 0;\n  if (!ID_RE.test(id)) {\n    throw new Error('Invalid composition id: ' + id);\n  }\n}","typeGuard":"const isCompositionIdValid = (id) => /^([a-zA-Z0-9-\\u4E00-\\u9FFF])+$/g.test(id);","tryCatchPattern":null,"preventionTips":["Adopt kebab-case composition ids from the start.","Note: underscore `_` is NOT allowed even though it is URL-safe.","Only CJK ideographs are allowed beyond ASCII — Latin diacritics are not."],"tags":["validation","composition","id","naming","url-safe"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}