remotion-dev/remotion · error

Output paths must be strings.

Error message

Output paths must be strings.

What it means

Thrown when `baseOutputPath` or `foregroundOutputPath` (after defaulting to `<baseName>-base.webm` / `<baseName>-foreground.webm`) is not a string. Both output names must be strings so they can be validated as public output names.

Source

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

							throw new Error('videoBitrate is invalid.');
						}

						const src = staticFile(assetPath);
						const displayName = assetPath.split('/').at(-1) ?? assetPath;
						const baseName = getDefaultOutputBaseName(
							src,
							displayName,
							'video',
						);
						const baseOutputPath =
							input.baseOutputPath ?? `${baseName}-base.webm`;
						const foregroundOutputPath =
							input.foregroundOutputPath ?? `${baseName}-foreground.webm`;
						if (
							typeof baseOutputPath !== 'string' ||
							typeof foregroundOutputPath !== 'string'
						) {
							throw new Error('Output paths must be strings.');
						}

						const baseError = validatePublicOutputName({
							extension: '.webm',
							outName: baseOutputPath,
						});
						const foregroundError = validatePublicOutputName({
							extension: '.webm',
							outName: foregroundOutputPath,
						});
						if (baseError !== null || foregroundError !== null) {
							throw new Error(
								baseError ?? foregroundError ?? 'Invalid output path.',
							);
						}

						if (
							baseOutputPath.normalize('NFC').toLowerCase() ===

View on GitHub (pinned to b2f4e34732)

Solutions

  1. Pass both paths as strings ending in .webm.
  2. Omit them and rely on the generated defaults.
  3. Coerce/validate with typeof x === 'string' before calling.

Example fix

// before
{ baseOutputPath: 123 }
// after
{ baseOutputPath: 'output-base.webm' }
Defensive patterns

Strategy: type-guard

Validate before calling

if ((p.baseOutputPath != null && typeof p.baseOutputPath !== 'string') || (p.foregroundOutputPath != null && typeof p.foregroundOutputPath !== 'string')) throw new Error('output paths must be strings');

Type guard

const isPathString = (v: unknown): v is string => typeof v === 'string';

Prevention

When it happens

Trigger: Explicitly passing output paths as numbers, arrays, or other non-string types via the tool input.

Common situations: Programmatic callers building paths via concatenation that yields a non-string, or agents passing null-ish placeholders that are not nullish-coalesced correctly.

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/2cbeb303b978790b. Report an issue: GitHub.