remotion-dev/remotion · error · TypeError

setImageSequence accepts a Boolean Value

Error message

setImageSequence accepts a Boolean Value

What it means

`Config.setImageSequence()` (packages/cli/src/config/image-sequence.ts) only accepts a real boolean. Passing any non-boolean value throws a TypeError because Remotion uses a strict runtime type guard rather than coercing. The flag controls whether rendering emits one image file per frame instead of a single video.

Source

Thrown at packages/cli/src/config/image-sequence.ts:7

import type {FrameRange} from '@remotion/renderer';

let imageSequence = false;

export const setImageSequence = (newImageSequence: boolean) => {
	if (typeof newImageSequence !== 'boolean') {
		throw new TypeError('setImageSequence accepts a Boolean Value');
	}

	imageSequence = newImageSequence;
};

export const getShouldOutputImageSequence = (frameRange: FrameRange | null) => {
	return imageSequence || typeof frameRange === 'number';
};

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Pass a literal boolean: `Config.setImageSequence(true)`.
  2. If the value comes from env/argv, coerce explicitly: `Config.setImageSequence(process.env.IMAGE_SEQUENCE === 'true')`.

Example fix

// before
Config.setImageSequence(process.env.IMAGE_SEQUENCE);
// after
Config.setImageSequence(process.env.IMAGE_SEQUENCE === 'true');
Defensive patterns

Strategy: type-guard

Validate before calling

const raw = process.env.IMAGE_SEQUENCE;
if (raw !== undefined && typeof raw !== 'boolean' && raw !== 'true' && raw !== 'false') {
  throw new Error('IMAGE_SEQUENCE must be "true", "false", or unset');
}
Config.setImageSequence(raw === 'true');

Type guard

const isBoolean = (v: unknown): v is boolean => typeof v === 'boolean';

Prevention

When it happens

Trigger: Calling `Config.setImageSequence('true')`, `setImageSequence(1)`, `setImageSequence(undefined)`, or `setImageSequence(null)` from a remotion config file. Any truthy non-boolean trips the guard.

Common situations: Reading a value from `process.env.IMAGE_SEQUENCE` (always a string) and passing it straight through; deserializing a JSON/argv value that arrives as a string or number; copy-pasting from docs that show the literal `true` into a template that wraps it in quotes.

Related errors


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