remotion-dev/remotion · error · TypeError

parameter 'diskSizeInMb' must be an integer but got ${diskSi

Error message

parameter 'diskSizeInMb' must be an integer but got ${diskSizeInMb}

What it means

Final guard in validateDiskSizeInMb: the value must be an integer (diskSizeInMb % 1 === 0). Fractional MB values are rejected because AWS Lambda ephemeral storage only accepts whole-megabyte increments.

Source

Thrown at packages/lambda-client/src/validate-disk-size-in-mb.ts:33

	}

	if (!Number.isFinite(diskSizeInMb)) {
		throw new TypeError(
			`parameter 'diskSizeInMb' must be finite, but is ${diskSizeInMb}`,
		);
	}

	if (
		diskSizeInMb < MIN_EPHEMERAL_STORAGE_IN_MB ||
		diskSizeInMb > MAX_EPHEMERAL_STORAGE_IN_MB
	) {
		throw new TypeError(
			`parameter 'diskSizeInMb' must be between ${MIN_EPHEMERAL_STORAGE_IN_MB} and ${MAX_EPHEMERAL_STORAGE_IN_MB}, but got ${diskSizeInMb}`,
		);
	}

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

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Round to the nearest integer with Math.round() before calling.
  2. Always specify disk size as an integer literal in config.
  3. Use Math.ceil() if you want to guarantee at least the computed capacity.

Example fix

// before
validateDiskSizeInMb(1024 * 1.55); // 1587.2 -> throws

// after
validateDiskSizeInMb(Math.ceil(1024 * 1.55)); // 1588
Defensive patterns

Strategy: validation

Validate before calling

if (!Number.isInteger(diskSizeInMb)) {
  diskSizeInMb = Math.ceil(diskSizeInMb);
}
validateDiskSizeInMb(diskSizeInMb);

Type guard

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

Prevention

When it happens

Trigger: Calling validateDiskSizeInMb with a finite, in-range but fractional number such as 2048.5 or 512.1.

Common situations: Computing disk size by multiplying a ratio (e.g., 1024 * 1.5 = 1536 is fine, but 1024 * 1.55 = 1587.2 is not); dividing storage into proportions; floating-point arithmetic producing small fractional remainders.

Related errors


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