{"record":{"id":"baea4bf62aa484fe","repo":"remotion-dev/remotion","slug":"remotion-hosted-layers-are-not-available-in-regi","errorCode":null,"errorMessage":"Remotion-hosted Layers are not available in ${region}.","messagePattern":"Remotion-hosted Layers are not available in (.+?)\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/lambda/src/shared/get-layers.ts","lineNumber":32,"sourceCode":"\t\t)\n\t) {\n\t\tthrow new Error(\n\t\t\t`Invalid runtime preference ${option}. Must be one of ${LambdaClientInternals.runtimePreferenceOptions.join(\n\t\t\t\t', ',\n\t\t\t)}`,\n\t\t);\n\t}\n};\n\nexport const getLayers = ({\n\toption,\n\tregion,\n}: {\n\toption: RuntimePreference;\n\tregion: AwsRegion;\n}): AwsLayer[] => {\n\tif (!(region in hostedLayers)) {\n\t\tthrow new Error(`Remotion-hosted Layers are not available in ${region}.`);\n\t}\n\n\treturn hostedLayers[region as HostedLayerRegion].filter((layer) => {\n\t\tif (layer.layerArn.includes('emoji-apple')) {\n\t\t\treturn option === 'apple-emojis';\n\t\t}\n\n\t\tif (layer.layerArn.includes('emoji-google')) {\n\t\t\treturn option !== 'apple-emojis';\n\t\t}\n\n\t\tif (layer.layerArn.includes('cjk')) {\n\t\t\treturn option !== 'apple-emojis';\n\t\t}\n\n\t\tif (layer.layerArn.includes('chromium')) {\n\t\t\treturn true;\n\t\t}","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/remotion-dev/remotion/blob/10db9de07356446fb0edb3c3ae211369b693d18b/packages/lambda/src/shared/get-layers.ts#L14-L50","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\nimport {getLayers} from '@remotion/lambda';\nconst layers = getLayers({region: 'cn-north-1', option: 'default'});\n\n// after: mirror layers into your own account and deploy with them\nawait deployFunction({\n  region: 'cn-north-1',\n  customLayerArns: ['arn:aws-cn:lambda:cn-north-1:123456789012:layer:remotion-chromium:1', /* ... */],\n});","handlingStrategy":"validation","validationCode":"import {getLayers as getHostedRegions} from '@remotion/lambda';\n// alternatively check a known region list before calling\nconst supported = ['us-east-1', 'us-east-2', 'eu-central-1' /* ... */];\nif (!supported.includes(region)) {\n  // branch to custom-layer deploy instead of getLayers\n}","typeGuard":"const isHostedLayerRegion = (r: string): r is 'us-east-1' /* union of hosted regions */ =>\n  ['us-east-1', 'us-east-2', 'eu-central-1' /* ... */].includes(r);","tryCatchPattern":"try {\n  const layers = getLayers({region, option});\n} catch (e) {\n  if (e instanceof Error && e.message.includes('not available in')) {\n    // fall back to deploying with customLayerArns\n  } else throw e;\n}","preventionTips":["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."],"tags":["aws","lambda-layers","region","aws-china"],"backgroundTag":"region-not-supported","analyzedSha":"10db9de07356446fb0edb3c3ae211369b693d18b","analyzedAt":"2026-08-22T21:45:17.748Z","contentChangedAt":"2026-08-22T21:45:17.748Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}