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
- Pass both paths as strings ending in .webm.
- Omit them and rely on the generated defaults.
- 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
- Build output paths with template literals so the result is always a string.
- Omit output paths to use generated defaults.
- Validate tool inputs against the schema before dispatch.
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
- ${baseError ?? foregroundError ?? 'Invalid output path.'}
- outputs.${layer}.outputWritable must be a WritableStream.
- src must be a string, URL, or Blob.
- outputs must be an object.
- onProgress must be a function.
AI-assisted analysis of remotion-dev/remotion@b2f4e34732 (2026-09-09).
Data as JSON: /api/errors/2cbeb303b978790b.
Report an issue: GitHub.