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
- Pick a Remotion-supported commercial region (e.g. us-east-1, eu-central-1) for hosted layers.
- 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.
- 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
- Pin your deploy script to regions you have verified are in hostedLayers for your @remotion/lambda version.
- Keep a per-project allow-list of regions and fail fast before AWS calls.
- For aws-cn/GovCloud, pre-build custom layers so hosted-layer code paths are never reached.
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
- customLayerArns must be specified when deploying to AWS Chin
- The custom Layer ARN ${layerArn} uses partition ${match[1]},
- The custom Layer ARN ${layerArn} is in region ${match[2]}, b
- ${region} is not a supported AWS region. Must be one of: ${A
- UnrecognizedClientException: The AWS credentials provided we
AI-assisted analysis of remotion-dev/remotion@10db9de073 (2026-08-22).
Data as JSON: /api/errors/baea4bf62aa484fe.
Report an issue: GitHub.