remotion-dev/remotion · error · TypeError

forceFullSequences must be a boolean.

Error message

forceFullSequences must be a boolean.

What it means

transcribe() in @remotion/whisper-webgpu validates its decoding options: forceFullSequences (after chunk/stride checks) must be a strict boolean because it toggles whether Whisper decodes whole sequences; any non-boolean value is rejected with a TypeError.

Source

Thrown at packages/whisper-webgpu/src/transcribe.ts:83

	if (!Number.isFinite(chunkLengthInSeconds) || chunkLengthInSeconds <= 0) {
		throw new Error(
			'chunkLengthInSeconds must be a finite number greater than 0.',
		);
	}

	if (
		!Number.isFinite(strideLengthInSeconds) ||
		strideLengthInSeconds < 0 ||
		strideLengthInSeconds * 2 >= chunkLengthInSeconds
	) {
		throw new Error(
			'strideLengthInSeconds must be a finite, non-negative number and less than half of chunkLengthInSeconds.',
		);
	}

	if (typeof forceFullSequences !== 'boolean') {
		throw new TypeError('forceFullSequences must be a boolean.');
	}

	if (typeof doSample !== 'boolean') {
		throw new TypeError('doSample must be a boolean.');
	}

	if (!Number.isFinite(temperature) || temperature <= 0) {
		throw new TypeError('temperature must be a finite number greater than 0.');
	}

	if (!Number.isInteger(topK) || topK < 0) {
		throw new TypeError('topK must be a non-negative integer.');
	}

	if (!Number.isFinite(repetitionPenalty) || repetitionPenalty <= 0) {
		throw new TypeError(
			'repetitionPenalty must be a finite number greater than 0.',
		);

View on GitHub (pinned to b2f4e34732)

Solutions

  1. Pass forceFullSequences: true or false explicitly
  2. Coerce string flags before calling: forceFullSequences === 'true'
  3. Ensure the options object actually contains the key when constructing from config/JSON

Example fix

// before
transcribe({...options, forceFullSequences: process.env.FULL_SEQ});
// after
transcribe({...options, forceFullSequences: process.env.FULL_SEQ === 'true'});
Defensive patterns

Strategy: type-guard

Validate before calling

if (typeof forceFullSequences !== 'boolean') throw new Error('forceFullSequences must be a boolean');

Type guard

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

Try / catch

try {
  await transcribe(options);
} catch (e) {
  if (e instanceof TypeError && e.message.startsWith('forceFullSequences')) {
    options.forceFullSequences = Boolean(options.forceFullSequences);
  } else throw e;
}

Prevention

When it happens

Trigger: Passing forceFullSequences as undefined (option omitted while being read from an untyped config), as the string 'true', or as 1/0 from a CLI flag parsed without boolean conversion.

Common situations: Options assembled from environment variables or query strings that are still strings; optional fields left unset from JSON config; TypeScript types bypassed via 'as any' or JS callers.

Understand the failure class

Background: Type mismatch errors: IllegalArgumentException, TypeError and type guards across 150 open-source libraries — this error's family across 150 libraries.

Related errors


AI-assisted analysis of remotion-dev/remotion@b2f4e34732 (2026-09-09). Data as JSON: /api/errors/b2d6c2f30e7c244e. Report an issue: GitHub.