remotion-dev/remotion · error · TypeError
The 'expiresIn' parameter must be less or equal than ${MAX_P
Error message
The 'expiresIn' parameter must be less or equal than ${MAX_PRESIGN_EXPIRATION} (7 days) as enforced by AWS What it means
Thrown by validatePresignExpiration() when expiresIn is an integer greater than 604800 (7 days). AWS S3 / Lambda presigned URLs cannot be valid for more than 7 days; this is a hard AWS-enforced ceiling, not a Remotion choice.
Source
Thrown at packages/lambda-client/src/validate-presign-expiration.ts:36
throw new TypeError(`'expiresIn' should not be NaN, but is NaN`);
}
if (!Number.isFinite(presignExpiration)) {
throw new TypeError(
`'expiresIn' should be finite but is ${presignExpiration}`,
);
}
if (presignExpiration % 1 !== 0) {
throw new TypeError(
`'expiresIn' should be an integer but is ${JSON.stringify(
presignExpiration,
)}`,
);
}
if (presignExpiration > MAX_PRESIGN_EXPIRATION) {
throw new TypeError(
`The 'expiresIn' parameter must be less or equal than ${MAX_PRESIGN_EXPIRATION} (7 days) as enforced by AWS`,
);
}
if (presignExpiration < MIN_PRESIGN_EXPIRATION) {
throw new TypeError(
`The 'expiresIn' parameter must be greater or equal than ${MIN_PRESIGN_EXPIRATION}`,
);
}
};
View on GitHub (pinned to 78fe4bb3fd)
Solutions
- Lower expiresIn to 604800 or less (e.g. 86400 for 24 hours).
- Double-check the unit: the value is in SECONDS, not minutes.
- If a longer-lived URL is truly needed, re-issue the presigned URL from your own backend before expiry instead of exceeding 7 days.
Example fix
// before
await renderMediaOnLambda({..., opts: {expiresIn: 7 * 24 * 3600 * 2}}); // 14 days
// after
await renderMediaOnLambda({..., opts: {expiresIn: 7 * 24 * 3600}}); // 7 days max Defensive patterns
Strategy: validation
Validate before calling
const SEVEN_DAYS = 604800; const expiresIn = Math.min(Math.round(Number(input)), SEVEN_DAYS);
Type guard
const isWithinAwsLimit = (v: unknown): v is number => typeof v === 'number' && Number.isFinite(v) && v % 1 === 0 && v >= 1 && v <= 604800;
Prevention
- Remember the value is in SECONDS and the ceiling is 7 days (604800).
- Re-issue presigned URLs from your backend instead of trying to exceed 7 days.
- Document the AWS ceiling next to every place expiresIn is set.
When it happens
Trigger: Passing expiresIn: 604801, expiresIn computed as 8 days in seconds (691200), or a long-lived token value copied from another system.
Common situations: Wanting a 'permanent' download link; confusing seconds with minutes/hours (passing 6048000 = ~70 days); copying a TTL from a non-AWS presign implementation.
Related errors
- The 'expiresIn' parameter must be greater or equal than ${MI
- maxRetries must be a number, but is ${JSON.stringify(maxRetr
- maxRetries must be finite, but is ${maxRetries}
- parameter 'vpcSecurityGroupIds' must either be 'undefined' o
- parameter 'vpcSubnetIds' must either be 'undefined' or a com
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/69d6a48f70204149.
Report an issue: GitHub.