remotion-dev/remotion · error · TypeError
The `<Video>` tag requires a string for `src`, but got ${JSO
Error message
The `<Video>` tag requires a string for `src`, but got ${JSON.stringify(src)} instead. What it means
Thrown by the public <Video> wrapper in @remotion/media when `src` is present but not a string. Remotion must serialize src into an asset manifest and preload it, so it requires a primitive string; URL objects, numbers, arrays, or any non-string are rejected before media validation runs.
Source
Thrown at packages/media/src/video/video.tsx:104
toneFrequency,
showInTimeline,
debugOverlay,
headless,
onError,
credentials,
requestInit,
controls,
objectFit,
_experimentalInitiallyDrawCachedFrame,
effects,
setMediaDurationInSeconds,
refForOutline,
...props
}) => {
const environment = useRemotionEnvironment();
if (typeof src !== 'string') {
throw new TypeError(
`The \`<Video>\` tag requires a string for \`src\`, but got ${JSON.stringify(
src,
)} instead.`,
);
}
validateMediaTrimProps({
startFrom: undefined,
endAt: undefined,
trimBefore,
trimAfter,
});
const {trimBeforeValue, trimAfterValue} = resolveTrimProps({
startFrom: undefined,
endAt: undefined,
trimBefore,
trimAfter,View on GitHub (pinned to 78fe4bb3fd)
Solutions
- Ensure src is a primitive string: <Video src={String(url)} /> or use url.href.
- Convert URL objects with .toString() before passing.
- Type the composition's src prop strictly as string.
Example fix
// before
<Video src={new URL('https://example.com/clip.mp4')} />
// after
<Video src={'https://example.com/clip.mp4'} /> Defensive patterns
Strategy: type-guard
Validate before calling
const videoSrc = typeof src === 'string' ? src : String(src ?? '');
<Video src={videoSrc} />; Type guard
const isStringSrc = (v: unknown): v is string => typeof v === 'string';
Prevention
- Type the src prop as string in your composition interface.
- Convert URL objects to strings (.href) before passing.
- Avoid spreading any-typed objects into media components.
When it happens
Trigger: Passing src as a URL object, a number, an object, or any non-string value to <Video>. Also triggered by spreading an any-typed props object whose src field is not a primitive string.
Common situations: Passing `new URL(...)` instead of the string form, passing a numeric asset id, or receiving src from an untyped source (parsed JSON, query param) without conversion.
Related errors
- The `<Audio>` tag requires a string for `src`, but got ${JSO
- No `src` was passed to <Video>.
- No src passed
- You have passed a volume of type ${typeof props.volume} to y
- You have passed a volume below 0 to your <${component} /> co
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/69cadc291b19f535.
Report an issue: GitHub.