remotion-dev/remotion · error · TypeError

${region} is not a supported AWS region. Must be one of: ${A

Error message

${region} is not a supported AWS region. Must be one of: ${AWS_REGIONS.join(', ')}

What it means

validateAwsRegion asserts that the supplied region is in the AWS_REGIONS allowlist. If not, it throws a TypeError listing every supported region. This guards every API that takes a region so an invalid/typo'd region fails fast with a clear enumeration rather than an opaque AWS error later.

Source

Thrown at packages/lambda-client/src/validate-aws-region.ts:8

import type {AwsRegion} from './regions';
import {AWS_REGIONS} from './regions';

export function validateAwsRegion(
	region: unknown,
): asserts region is AwsRegion {
	if (!AWS_REGIONS.includes(region as AwsRegion)) {
		throw new TypeError(
			`${region} is not a supported AWS region. Must be one of: ${AWS_REGIONS.join(
				', ',
			)}`,
		);
	}
}

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Use one of the regions listed in the error message.
  2. Strip whitespace from the region value before passing it.
  3. If you need an unsupported region, request support or use the closest supported one.
  4. Confirm the region matches where your Lambda function was deployed.

Example fix

// before
validateAwsRegion('us-east-1 ');

// after
validateAwsRegion('us-east-1');
Defensive patterns

Strategy: type-guard

Validate before calling

import { AWS_REGIONS } from '@remotion/lambda-client';
const region = String(rawRegion).trim();
if (!AWS_REGIONS.includes(region as any)) {
  throw new Error(`Unsupported region: ${rawRegion}. Supported: ${AWS_REGIONS.join(', ')}`);
}

Type guard

import type { AwsRegion } from '@remotion/lambda-client';
import { AWS_REGIONS } from '@remotion/lambda-client';
const isAwsRegion = (r: unknown): r is AwsRegion =>
  typeof r === 'string' && (AWS_REGIONS as readonly string[]).includes(r);

Prevention

When it happens

Trigger: Calling any Lambda-client API that runs validateAwsRegion(region) with a region string not present in AWS_REGIONS (e.g., 'us-east-2 ' with trailing space, 'us-east1', 'us-east-1a' (an AZ), 'cn-north-1' unsupported).

Common situations: Typo in region env var; using an Availability Zone ID instead of a region; trailing whitespace from copy/paste; pointing at a region not yet supported by Remotion Lambda; using a non-AWS partition region (China/GovCloud) that is not in the allowlist.

Related errors


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