remotion-dev/remotion · error · TypeError
parameter 'timeoutInSeconds' must be a number, but got a ${t
Error message
parameter 'timeoutInSeconds' must be a number, but got a ${typeof timeoutInSeconds} What it means
Thrown by validateTimeout() in @remotion/lambda when the 'timeoutInSeconds' option is not a number. This is the per-function execution timeout (in whole seconds) used when deploying the Remotion Lambda function; valid range is MIN_TIMEOUT (15) to MAX_TIMEOUT (900).
Source
Thrown at packages/lambda/src/shared/validate-timeout.ts:5
import {MAX_TIMEOUT, MIN_TIMEOUT} from '@remotion/lambda-client/constants';
export const validateTimeout = (timeoutInSeconds: unknown) => {
if (typeof timeoutInSeconds !== 'number') {
throw new TypeError(
`parameter 'timeoutInSeconds' must be a number, but got a ${typeof timeoutInSeconds}`,
);
}
if (Number.isNaN(timeoutInSeconds)) {
throw new TypeError(`parameter 'timeoutInSeconds' must not be NaN, but is`);
}
if (!Number.isFinite(timeoutInSeconds)) {
throw new TypeError(
`parameter 'timeoutInSeconds' must be finite, but is ${timeoutInSeconds}`,
);
}
if (timeoutInSeconds < MIN_TIMEOUT || timeoutInSeconds > MAX_TIMEOUT) {
throw new TypeError(
`parameter 'timeoutInSeconds' must be between ${MIN_TIMEOUT} and ${MAX_TIMEOUT}, but got ${timeoutInSeconds}`,
);View on GitHub (pinned to 78fe4bb3fd)
Solutions
- Pass a number literal: timeoutInSeconds: 120.
- Coerce from config: const timeoutInSeconds = Number(config.timeout); then verify it is a finite integer in [15,900].
- If using env vars, parse and validate before passing.
Example fix
// before
await deployFunction({ timeoutInSeconds: process.env.LAMBDA_TIMEOUT }); // string | undefined
// after
const timeoutInSeconds = Number(process.env.LAMBDA_TIMEOUT) || 120;
await deployFunction({ timeoutInSeconds }); Defensive patterns
Strategy: validation
Validate before calling
const raw = Number(config.timeout); const timeoutInSeconds = Number.isFinite(raw) ? raw : 120; // then validate range/integer
Type guard
const isNumber = (v: unknown): v is number => typeof v === 'number';
Prevention
- Type timeoutInSeconds as number in config schemas (not string).
- Always pair the field with a numeric default.
- Convert env vars with Number() and check isFinite before passing.
When it happens
Trigger: Calling deployFunction() (or any API that propagates timeoutInSeconds) with a non-number value: a string like '120', undefined (when not defaulted), null, or an object.
Common situations: Reading the timeout from a JSON/YAML config or env var and passing the raw string; allowing the field to be optional without a default; passing undefined because the field name was misspelled.
Understand the failure class
- Timeouts: ETIMEDOUT, deadlines, and hung requests — what actually expires when a request times out.
Related errors
- parameter 'timeoutInSeconds' must not be NaN, but is
- parameter 'timeoutInSeconds' must be finite, but is ${timeou
- parameter 'timeoutInSeconds' must be between ${MIN_TIMEOUT}
- parameter 'timeoutInSeconds' must be an integer but got ${ti
- parameter 'vpcSecurityGroupIds' must either be 'undefined' o
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/d3f468278b90b877.
Report an issue: GitHub.