remotion-dev/remotion · error · Error
Composition id can only contain a-z, A-Z, 0-9, CJK character
Error message
Composition id can only contain a-z, A-Z, 0-9, CJK characters and -. You passed ${id} What it means
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.
Source
Thrown at packages/core/src/validation/validate-composition-id.ts:7
const getRegex = () => /^([a-zA-Z0-9-\u4E00-\u9FFF])+$/g;
export const isCompositionIdValid = (id: string) => id.match(getRegex());
export const validateCompositionId = (id: string) => {
if (!isCompositionIdValid(id)) {
throw new Error(
`Composition id can only contain a-z, A-Z, 0-9, CJK characters and -. You passed ${id}`,
);
}
};
export const invalidCompositionErrorMessage = `Composition ID must match ${String(
getRegex(),
)}`;
View on GitHub (pinned to 78fe4bb3fd)
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.
Example fix
// before <Composition id="my_comp.v2" ... /> // after <Composition id="my-comp-v2" ... />
Defensive patterns
Strategy: validation
Validate before calling
const ID_RE = /^([a-zA-Z0-9-\u4E00-\u9FFF])+$/g;
function assertCompositionId(id) {
ID_RE.lastIndex = 0;
if (!ID_RE.test(id)) {
throw new Error('Invalid composition id: ' + id);
}
} Type guard
const isCompositionIdValid = (id) => /^([a-zA-Z0-9-\u4E00-\u9FFF])+$/g.test(id);
Prevention
- 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.
When it happens
Trigger: 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).
Common situations: 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.
Related errors
- Folder name can only contain a-z, A-Z, 0-9 and -. You passed
- No composition with the ID "${compId}" found.
- The bucketName parameter must start with ${REMOTION_BUCKET_P
- The bucket ${bucketName}
- The `siteName` must match the RegExp `/^[-0-9a-zA-Z!_.*'()]+
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/77bb915de82f5bd0.
Report an issue: GitHub.