remotion-dev/remotion · error · TypeError

"region" parameter must be one of ${GCP_REGIONS.join(', ')},

Error message

"region" parameter must be one of ${GCP_REGIONS.join(', ')}, but is ${JSON.stringify(region)}

What it means

Thrown by validateRegion() when region is a string but not in GCP_REGIONS. The message lists all valid regions and echoes the offending value. This is the value/membership check that runs after the string-type guard.

Source

Thrown at packages/cloudrun/src/shared/validate-region.ts:13

import type {GcpRegion} from '../pricing/gcp-regions';
import {GCP_REGIONS} from '../pricing/gcp-regions';

export const validateRegion = (region: unknown) => {
	if (typeof region !== 'string') {
		throw new TypeError(
			`"region" parameter must be a string, but is ${JSON.stringify(region)}`,
		);
	}

	// check region is part of GCP_REGIONS list
	if (!GCP_REGIONS.includes(region as GcpRegion)) {
		throw new TypeError(
			`"region" parameter must be one of ${GCP_REGIONS.join(
				', ',
			)}, but is ${JSON.stringify(region)}`,
		);
	}

	return region as GcpRegion;
};

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Use a region from the printed list, e.g. 'us-east1', 'us-central1', 'europe-west1'.
  2. Upgrade @remotion/cloudrun if your region was added after your installed version.
  3. Confirm the region string in the GCP console and copy it exactly.

Example fix

// before
await deployService({ region: 'us-east-1', ... }); // AWS-style name
// after
await deployService({ region: 'us-east1', ... }); // GCP-style name
Defensive patterns

Strategy: validation

Validate before calling

import { GCP_REGIONS } from '@remotion/cloudrun/pricing/gcp-regions';
if (!(GCP_REGIONS as readonly string[]).includes(region)) {
  throw new Error(`Invalid GCP region: ${region}. Valid: ${GCP_REGIONS.join(', ')}`);
}

Type guard

import { GCP_REGIONS } from '@remotion/cloudrun/pricing/gcp-regions';
function isValidGcpRegion(v: unknown): boolean {
  return typeof v === 'string' && (GCP_REGIONS as readonly string[]).includes(v);
}

Try / catch

// Validate once at config load; do not retry on invalid region.

Prevention

When it happens

Trigger: Passing a region string not in GCP_REGIONS — e.g., an AWS region name ('us-east-1'), a typo ('us-east11'), or a GCP region Remotion does not yet list.

Common situations: Confusing AWS and GCP region naming; using a newly announced GCP region not yet in the installed @remotion/cloudrun version; copy-pasting from Lambda examples; typo.

Related errors


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