remotion-dev/remotion · error

${outputError}

Error message

${outputError}

What it means

After type-checking, outputPath is passed through validateCaptionOutputName(), which returns a human-readable error string for invalid output names (e.g. missing or unsupported extension, illegal path characters, path traversal). If non-null, that string is thrown verbatim as this error.

Source

Thrown at packages/studio/src/components/WebMcp.tsx:602

							typeof forceFullSequences !== 'boolean' ||
							typeof doSample !== 'boolean'
						) {
							throw new Error(
								'forceFullSequences and doSample must be booleans.',
							);
						}

						const src = staticFile(assetPath);
						const displayName = assetPath.split('/').at(-1) ?? assetPath;
						const outputPath =
							input.outputPath ?? getDefaultCaptionOutputName(src, displayName);
						if (typeof outputPath !== 'string') {
							throw new Error('outputPath must be a string.');
						}

						const outputError = validateCaptionOutputName(outputPath);
						if (outputError !== null) {
							throw new Error(outputError);
						}

						const jobId = addCaptionJob({
							audioStreamIndex: null,
							chunkLengthInSeconds,
							displayName,
							doSample,
							forceFullSequences,
							language: model.multilingual ? language : null,
							model: model.name,
							noRepeatNgramSize,
							outName: outputPath,
							repetitionPenalty,
							requestInit: null,
							src,
							strideLengthInSeconds,
							task,
							temperature,

View on GitHub (pinned to b2f4e34732)

Solutions

  1. Read the thrown message for the specific rule violated and correct outputPath accordingly
  2. Use a supported caption extension such as .srt or .vtt
  3. Use a simple relative file name without directories, dots, or special characters

Example fix

// before
{ "outputPath": "../../secrets/out.srt" }
// after
{ "outputPath": "captions-en.srt" }
Defensive patterns

Strategy: try-catch

Validate before calling

const safeName = /^[A-Za-z0-9._-]+\.(srt|vtt)$/.test(outputPath)
  ? outputPath : 'captions.srt';

Type guard

const isValidOutputName = (v: string): boolean =>
  /^[A-Za-z0-9._-]+\.(srt|vtt)$/.test(v);

Try / catch

try {
  await callWhisperTool({ outputPath });
} catch (err) {
  if (err instanceof Error) {
    // message is the validateCaptionOutputName() reason; fix and retry
    const fixed = 'captions.srt';
    await callWhisperTool({ outputPath: fixed });
  }
}

Prevention

When it happens

Trigger: Passing an output name with a disallowed extension (e.g. ".docx" instead of ".srt"/".vtt"), empty name, absolute paths, ".." path segments, or characters invalid in file names.

Common situations: Requesting output formats the caption writer does not support; trying to write outside the public folder with ../ traversal; filenames with slashes or reserved characters.

Understand the failure class

Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.

Related errors


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