remotion-dev/remotion · error · Error
The `project-id` must match the RegExp `/^[a-zA-Z][a-zA-Z0-9
Error message
The `project-id` must match the RegExp `/^[a-zA-Z][a-zA-Z0-9-]{0,48}[a-zA-Z0-9]$/g`. This means it may only start with a letter, end with a letter or number, and contain up to 49 lowercase letters, numbers or hyphens. You passed: ${projectID}. Check for invalid characters. What it means
Thrown by validateProjectID() when projectID fails the GCP project-id naming regex: must start with a letter, end with a letter or number, contain only lowercase letters, digits, and hyphens, with total length 6-50 (one leading letter + up to 48 middle + one trailing). Enforces Google's project id rules before the API call to avoid opaque GCP errors.
Source
Thrown at packages/cloudrun/src/shared/validate-project-id.ts:17
export const validateProjectID = (projectID: unknown) => {
if (typeof projectID === 'undefined') {
throw new TypeError(
`The 'project-id' argument must be provided, but is missing.`,
);
}
if (typeof projectID !== 'string') {
throw new TypeError(
`The 'project-id' argument must be a string, but is ${JSON.stringify(
projectID,
)}`,
);
}
if (!projectID.match(/^[a-zA-Z][a-zA-Z0-9-]{0,48}[a-zA-Z0-9]$/g)) {
throw new Error(
'The `project-id` must match the RegExp `/^[a-zA-Z][a-zA-Z0-9-]{0,48}[a-zA-Z0-9]$/g`. This means it may only start with a letter, end with a letter or number, and contain up to 49 lowercase letters, numbers or hyphens. You passed: ' +
projectID +
'. Check for invalid characters.',
);
}
};
View on GitHub (pinned to 78fe4bb3fd)
Solutions
- Use the exact project id from the GCP console (lowercase, hyphens, letters/digits).
- Strip accidental whitespace and lowercase the value before passing.
- If the value contains underscores, switch to the canonical hyphenated project id.
Example fix
// before
await deployService({ projectID: 'My_Project', ... });
// after
await deployService({ projectID: 'my-project', ... }); Defensive patterns
Strategy: validation
Validate before calling
const PROJECT_ID_RE = /^[a-zA-Z][a-zA-Z0-9-]{0,48}[a-zA-Z0-9]$/;
if (!PROJECT_ID_RE.test(projectID)) {
throw new Error(`Invalid GCP project id: ${projectID}`);
}
validateProjectID(projectID); Type guard
function isValidGcpProjectId(v: string): boolean {
return /^[a-zA-Z][a-zA-Z0-9-]{0,48}[a-zA-Z0-9]$/.test(v);
} Try / catch
// Validate before the API call; do not retry — value is deterministic.
Prevention
- Copy the project id verbatim from the GCP console.
- Avoid uppercase and underscores; use lowercase and hyphens only.
- Trim whitespace before validating.
When it happens
Trigger: Passing a project id with uppercase letters, an underscore, a leading digit, a trailing hyphen, or out-of-range length. The message echoes the regex and the offending value.
Common situations: Typo; mixing project name (which permits uppercase) with project id (which does not); trailing whitespace; copy-paste with forbidden characters.
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 'project-id' argument must be provided, but is missing.
- The 'project-id' argument must be a string, but is ${JSON.st
- Bucket creation is required, but no region has been passed.
- Either cloudRunUrl or serviceName must be provided
- Either cloudRunUrl or serviceName must be provided, not both
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/a6536bd5c09704ed.
Report an issue: GitHub.