remotion-dev/remotion · error · TypeError

parameter 'timeoutInSeconds' must be finite, but is ${timeou

Error message

parameter 'timeoutInSeconds' must be finite, but is ${timeoutInSeconds}

What it means

Thrown by validateTimeout() in @remotion/lambda when timeoutInSeconds is a non-finite number other than NaN (i.e. Infinity or -Infinity). Lambda timeouts must be a concrete number of seconds in [15, 900]; Infinity is not a valid AWS Lambda timeout.

Source

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

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

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

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Replace Infinity with the maximum allowed value MAX_TIMEOUT (900 seconds), or a realistic number like 300.
  2. Clamp: const timeoutInSeconds = Math.min(Math.max(parsed, MIN_TIMEOUT), MAX_TIMEOUT);
  3. Reject 'unlimited' at the config layer and require a concrete number.

Example fix

// before
const timeoutInSeconds = duration / 0; // Infinity

// after
import {MAX_TIMEOUT, MIN_TIMEOUT} from '@remotion/lambda-client/constants';
const timeoutInSeconds = Math.min(Math.max(Math.round(duration), MIN_TIMEOUT), MAX_TIMEOUT);
Defensive patterns

Strategy: validation

Validate before calling

import {MAX_TIMEOUT, MIN_TIMEOUT} from '@remotion/lambda-client/constants';
const t = Math.min(Math.max(Math.round(raw), MIN_TIMEOUT), MAX_TIMEOUT);

Type guard

const isFiniteSeconds = (v: unknown): v is number =>
  typeof v === 'number' && Number.isFinite(v);

Prevention

When it happens

Trigger: Passing timeoutInSeconds: Infinity or -Infinity, or a computation that overflows (e.g. dividing a large number by ~0).

Common situations: Using Infinity as a 'no limit' marker; computing timeout as duration / concurrency where concurrency approaches 0; copying a value from a UI 'unlimited' field represented as Infinity.

Understand the failure class

Related errors


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