remotion-dev/remotion · error · TypeError

parameter 'timeoutInSeconds' must be between ${MIN_TIMEOUT}

Error message

parameter 'timeoutInSeconds' must be between ${MIN_TIMEOUT} and ${MAX_TIMEOUT}, but got ${timeoutInSeconds}

What it means

Thrown by validateTimeout() in @remotion/lambda when timeoutInSeconds is a finite number outside the allowed range [MIN_TIMEOUT (15), MAX_TIMEOUT (900)] seconds. AWS Lambda allows function timeouts up to 900s (15 min); Remotion additionally enforces a 15s minimum below which renders cannot reasonably run.

Source

Thrown at packages/lambda/src/shared/validate-timeout.ts:21

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}`,
		);
	}

	if (timeoutInSeconds % 1 !== 0) {
		throw new TypeError(
			`parameter 'timeoutInSeconds' must be an integer but got ${timeoutInSeconds}`,
		);
	}
};

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Pick a value in [15, 900]; for long renders use 900 (the maximum).
  2. Clamp automatically: const t = Math.min(Math.max(requested, 15), 900);
  3. Double-check the unit: this option is SECONDS, not milliseconds or minutes.

Example fix

// before
await deployFunction({ timeoutInSeconds: 1200 }); // over the 900s Lambda ceiling

// after
await deployFunction({ timeoutInSeconds: 900 });
Defensive patterns

Strategy: validation

Validate before calling

import {MAX_TIMEOUT, MIN_TIMEOUT} from '@remotion/lambda-client/constants';
if (timeoutInSeconds < MIN_TIMEOUT || timeoutInSeconds > MAX_TIMEOUT) {
  throw new Error(`timeoutInSeconds must be in [${MIN_TIMEOUT}, ${MAX_TIMEOUT}]`);
}

Type guard

import {MAX_TIMEOUT, MIN_TIMEOUT} from '@remotion/lambda-client/constants';
const isValidTimeout = (v: unknown): v is number =>
  typeof v === 'number' && Number.isInteger(v) && v >= MIN_TIMEOUT && v <= MAX_TIMEOUT;

Prevention

When it happens

Trigger: Passing timeoutInSeconds < 15 (e.g. 10) or > 900 (e.g. 1200) to deployFunction() or related APIs.

Common situations: Setting a very low timeout to 'save cost' that undercuts the minimum; assuming AWS's 15-minute ceiling is in minutes and passing 1200 (thinking 20 min); copying a value from another tool with different units (milliseconds vs seconds).

Understand the failure class

Related errors


AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12). Data as JSON: /api/errors/e8621fdf20bd813c. Report an issue: GitHub.