remotion-dev/remotion · error · Error

Remotion-hosted Layers are not available in ${region}.

Error message

Remotion-hosted Layers are not available in ${region}.

What it means

Thrown by getLayers, the function behind `npx remotion lambda layers` and the `layers` API, when the requested region has no entry in the library's hostedLayers table. Remotion only publishes its rendering layers (chromium, fonts, emoji) to a fixed list of commercial AWS regions; for any other region (including aws-cn and GovCloud) there is nothing to list.

Source

Thrown at packages/lambda/src/shared/get-layers.ts:32

		)
	) {
		throw new Error(
			`Invalid runtime preference ${option}. Must be one of ${LambdaClientInternals.runtimePreferenceOptions.join(
				', ',
			)}`,
		);
	}
};

export const getLayers = ({
	option,
	region,
}: {
	option: RuntimePreference;
	region: AwsRegion;
}): AwsLayer[] => {
	if (!(region in hostedLayers)) {
		throw new Error(`Remotion-hosted Layers are not available in ${region}.`);
	}

	return hostedLayers[region as HostedLayerRegion].filter((layer) => {
		if (layer.layerArn.includes('emoji-apple')) {
			return option === 'apple-emojis';
		}

		if (layer.layerArn.includes('emoji-google')) {
			return option !== 'apple-emojis';
		}

		if (layer.layerArn.includes('cjk')) {
			return option !== 'apple-emojis';
		}

		if (layer.layerArn.includes('chromium')) {
			return true;
		}

View on GitHub (pinned to 10db9de073)

Solutions

  1. Pick a Remotion-supported commercial region (e.g. us-east-1, eu-central-1) for hosted layers.
  2. For unsupported regions (aws-cn, GovCloud, brand-new regions), copy the Remotion layers into your own account and deploy with `customLayerArns` instead of using hosted layers.
  3. Upgrade @remotion/lambda to the latest version in case the region has since been added to hostedLayers.

Example fix

// before
import {getLayers} from '@remotion/lambda';
const layers = getLayers({region: 'cn-north-1', option: 'default'});

// after: mirror layers into your own account and deploy with them
await deployFunction({
  region: 'cn-north-1',
  customLayerArns: ['arn:aws-cn:lambda:cn-north-1:123456789012:layer:remotion-chromium:1', /* ... */],
});
Defensive patterns

Strategy: validation

Validate before calling

import {getLayers as getHostedRegions} from '@remotion/lambda';
// alternatively check a known region list before calling
const supported = ['us-east-1', 'us-east-2', 'eu-central-1' /* ... */];
if (!supported.includes(region)) {
  // branch to custom-layer deploy instead of getLayers
}

Type guard

const isHostedLayerRegion = (r: string): r is 'us-east-1' /* union of hosted regions */ =>
  ['us-east-1', 'us-east-2', 'eu-central-1' /* ... */].includes(r);

Try / catch

try {
  const layers = getLayers({region, option});
} catch (e) {
  if (e instanceof Error && e.message.includes('not available in')) {
    // fall back to deploying with customLayerArns
  } else throw e;
}

Prevention

When it happens

Trigger: Calling `getLayers({region, ...})` or `npx remotion lambda layers -r <region>` with a region key that is not present in hostedLayers, e.g. an aws-cn region like cn-north-1 or a newly opened region Remotion has not published to.

Common situations: Deploying Remotion Lambda in AWS China where Remotion-hosted layers cannot be shipped; using a region added after your @remotion/lambda version was released; typos in the region string.

Related errors


AI-assisted analysis of remotion-dev/remotion@10db9de073 (2026-08-22). Data as JSON: /api/errors/baea4bf62aa484fe. Report an issue: GitHub.