remotion-dev/remotion · error · TypeError

The 'project-id' argument must be a string, but is ${JSON.st

Error message

The 'project-id' argument must be a string, but is ${JSON.stringify(projectID)}

What it means

Thrown by validateProjectID() when projectID is defined but not a string (number, object, array, boolean). Runs after the undefined check, so it specifically catches the case where a value was provided but has the wrong type.

Source

Thrown at packages/cloudrun/src/shared/validate-project-id.ts:9

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. Pass the project id string (e.g., 'my-project-123'), not the numeric project number.
  2. Coerce: if you only have the number, look up the project id in the GCP console.
  3. Validate the value's type before calling the API.

Example fix

// before
await deployService({ projectID: 1234567890, ... }); // numeric project number
// after
await deployService({ projectID: 'my-project-123', ... }); // string project id
Defensive patterns

Strategy: type-guard

Validate before calling

import { validateProjectID } from '@remotion/cloudrun/shared';
validateProjectID(projectID);

Type guard

function isProjectIDString(v: unknown): v is string {
  return typeof v === 'string';
}

Try / catch

if (typeof projectID !== 'string') throw new TypeError('projectID must be a string id, not a number');

Prevention

When it happens

Trigger: Passing a non-string projectID such as a numeric project number, an object, or an array. Note: GCP distinguishes project id (string) from project number (numeric); only the string id is accepted.

Common situations: Passing the numeric project number from the GCP console instead of the string project id; passing a parsed JSON value of the wrong type.

Related errors


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