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

  1. Use the exact project id from the GCP console (lowercase, hyphens, letters/digits).
  2. Strip accidental whitespace and lowercase the value before passing.
  3. 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

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

Related errors


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