remotion-dev/remotion · error · TypeError
customLayerArns must contain at least one Layer ARN.
Error message
customLayerArns must contain at least one Layer ARN.
What it means
validateCustomLayerArns throws this TypeError when customLayerArns is an array with zero entries (or not an array at all). Passing an empty list is treated as a configuration mistake: you either want Remotion-hosted layers (pass null) or you must list at least one layer version ARN.
Source
Thrown at packages/lambda/src/shared/validate-custom-layer-arns.ts:33
}: {
customLayerArns: string[] | null;
enableLambdaInsights: boolean;
region: AwsRegion;
runtimePreference: RuntimePreference;
}) => {
const {partition} = LambdaClientInternals.getAwsRegionMetadata(region);
if (customLayerArns === null) {
if (partition === 'aws-cn') {
throw new Error(
'customLayerArns must be specified when deploying to AWS China regions because Remotion-hosted Layers are not available in the aws-cn partition.',
);
}
return;
}
if (!Array.isArray(customLayerArns) || customLayerArns.length === 0) {
throw new TypeError('customLayerArns must contain at least one Layer ARN.');
}
if (runtimePreference !== 'default') {
throw new Error(
'customLayerArns cannot be combined with a non-default runtimePreference.',
);
}
if (customLayerArns.length + (enableLambdaInsights ? 1 : 0) > 5) {
throw new Error(
'Lambda functions support at most 5 Layers, including the Lambda Insights Layer.',
);
}
const seen = new Set<string>();
for (const layerArn of customLayerArns) {
if (typeof layerArn !== 'string' || layerArn.length === 0) {
throw new TypeError(View on GitHub (pinned to 10db9de073)
Solutions
- Pass `customLayerArns: null` (or omit it) if you want Remotion-hosted layers.
- Otherwise include at least one valid layer version ARN in the array.
Example fix
// before
await deployFunction({region: 'us-east-1', customLayerArns: []});
// after: hosted layers
await deployFunction({region: 'us-east-1', customLayerArns: null}); Defensive patterns
Strategy: validation
Validate before calling
const layers = customLayerArns ?? null;
if (layers !== null && layers.length === 0) {
throw new Error('customLayerArns must be null or non-empty');
} Prevention
- Treat `null` as the 'use hosted layers' signal; never pass [] as a placeholder.
- When building layer lists dynamically, map an empty result to null.
When it happens
Trigger: Calling deployFunction with `customLayerArns: []`, or with a variable that was intended to be null but was initialized as an empty array.
Common situations: Scripts that build the layer list dynamically and end up empty (e.g. a filter removed everything); passing `[]` as a 'use defaults' signal, which this API does not accept.
Understand the failure class
Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.
Related errors
- customLayerArns cannot be combined with a non-default runtim
- Each customLayerArns entry must be a non-empty string.
- inputRange must contain only numbers
- outputStyles must contain only objects
- Argument passed to "${api}" for param "${param}" is undefine
AI-assisted analysis of remotion-dev/remotion@10db9de073 (2026-08-22).
Data as JSON: /api/errors/e13895c9d5b1ec65.
Report an issue: GitHub.