remotion-dev/remotion · error · Error

Folder name can only contain a-z, A-Z, 0-9 and -. You passed

Error message

Folder name can only contain a-z, A-Z, 0-9 and -. You passed ${name}

What it means

`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.

Source

Thrown at packages/core/src/validation/validate-folder-name.ts:17

const getRegex = () => /^([a-zA-Z0-9-\u4E00-\u9FFF])+$/g;

export const isFolderNameValid = (name: string) => name.match(getRegex());

export const validateFolderName = (name: string | null) => {
	if (name === undefined || name === null) {
		throw new TypeError('You must pass a name to a <Folder />.');
	}

	if (typeof name !== 'string') {
		throw new TypeError(
			`The "name" you pass into <Folder /> must be a string. Got: ${typeof name}`,
		);
	}

	if (!isFolderNameValid(name)) {
		throw new Error(
			`Folder name can only contain a-z, A-Z, 0-9 and -. You passed ${name}`,
		);
	}
};

export const invalidFolderNameErrorMessage = `Folder name must match ${String(
	getRegex(),
)}`;

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Use kebab-case: only a-z, 0-9, hyphen (e.g. `'my-folder'`).
  2. For hierarchy, nest `<Folder>` components rather than using `/`.
  3. Sanitize dynamic names by stripping disallowed characters.

Example fix

// before
<Folder name="my_folder/v2">...</Folder>
// after
<Folder name="my-folder">
  <Folder name="v2">...</Folder>
</Folder>
Defensive patterns

Strategy: validation

Validate before calling

const NAME_RE = /^([a-zA-Z0-9-\u4E00-\u9FFF])+$/g;
if (!NAME_RE.test(name)) { throw new Error('Invalid folder name: ' + name); }

Type guard

const isFolderNameValid = (n) => /^([a-zA-Z0-9-\u4E00-\u9FFF])+$/g.test(n);

Prevention

When it happens

Trigger: Naming a `<Folder>` with spaces, underscores (`my_folder`), dots (`v1.2`), slashes (`a/b`), or other punctuation; using emoji or non-CJK Unicode.

Common situations: 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.

Related errors


AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12). Data as JSON: /api/errors/d2fe8049c6c66e58. Report an issue: GitHub.