remotion-dev/remotion · error · Error
The `siteName` must match the RegExp `/^[-0-9a-zA-Z!_.*'()]+
Error message
The `siteName` must match the RegExp `/^[-0-9a-zA-Z!_.*'()]+/`. You passed: ${siteName}. Check for invalid characters. What it means
Thrown by validateSiteName() when siteName contains characters outside the allowed set defined by VALID_SITE_NAME_RE = /^[-0-9a-zA-Z!_.*'()]+$/. The message embeds the regex source so the caller can see exactly which characters are permitted.
Source
Thrown at packages/cloudrun/src/shared/validate-site-name.ts:23
return;
}
if (typeof siteName !== 'string') {
throw new TypeError(
`The 'siteName' argument must be a string if provided, but is ${JSON.stringify(
siteName,
)}`,
);
}
if (siteName === '.' || siteName === '..') {
throw new Error(
'The `siteName` must not be `.` or `..`. You passed: ' + siteName + '.',
);
}
if (!VALID_SITE_NAME_RE.test(siteName)) {
throw new Error(
'The `siteName` must match the RegExp `/' +
VALID_SITE_NAME_RE.source +
'/`. You passed: ' +
siteName +
'. Check for invalid characters.',
);
}
};
View on GitHub (pinned to 78fe4bb3fd)
Solutions
- Restrict the site name to the allowed characters: alphanumerics, '-', and the punctuation in the regex.
- Strip or replace disallowed characters (spaces, slashes) before passing.
- Generate the name from a slug/kebab-case helper to guarantee validity.
Example fix
// before
deploySite({ siteName: 'My Project Site!', ... });
// after
const slug = 'My Project Site!'.replace(/[^-0-9a-zA-Z!_.*'()]/g, '-');
deploySite({ siteName: slug, ... }); Defensive patterns
Strategy: validation
Validate before calling
const VALID_SITE_NAME_RE = /^[-0-9a-zA-Z!_.*'()]+$/;
if (typeof siteName === 'string' && !VALID_SITE_NAME_RE.test(siteName)) {
throw new Error('siteName contains invalid characters');
} Type guard
const SITE_NAME_RE = /^[-0-9a-zA-Z!_.*'()]+$/; const isValidSiteName = (v: unknown): v is string => typeof v === 'string' && SITE_NAME_RE.test(v);
Prevention
- Generate site names with a kebab-case/slug helper.
- Strip spaces and slashes from user-provided names before passing.
- Mirror the validator's regex in your own form validation.
When it happens
Trigger: Passing a site name containing spaces, slashes, commas, ampersands, @, #, or any other character not in the allowed class. Also triggered by names with leading/trailing whitespace or unicode characters.
Common situations: Using a human-readable label with spaces as the site name; including a path separator ('/') intending a folder hierarchy; copy/pasting a name with trailing whitespace or a special punctuation character.
Understand the failure class
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
Related errors
- The bucketName parameter must start with ${REMOTION_BUCKET_P
- The bucket ${bucketName}
- The `siteName` must not be `.` or `..`. You passed: ${siteNa
- Bucket creation is required, but no region has been passed.
- Either cloudRunUrl or serviceName must be provided
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/2a65fcff1a63848e.
Report an issue: GitHub.