remotion-dev/remotion · error · Error
No src passed
Error message
No src passed
What it means
Thrown synchronously by useBasicMediaInTimeline when its `src` argument is falsy (undefined, null, or empty string). This hook backs Audio/Video/Img timeline registration, so a missing src means there is no media to schedule. It fires during render (not in an effect), so it aborts the component's first render.
Source
Thrown at packages/core/src/use-media-in-timeline.ts:51
playbackRate,
sequenceDurationInFrames,
mediaStartsAt,
loop,
}: {
volume: VolumeProp | undefined;
mediaVolume: number;
mediaType: 'audio' | 'video' | 'image';
src: string | undefined;
displayName: string | null;
trimBefore: number | undefined;
trimAfter: number | undefined;
playbackRate: number;
sequenceDurationInFrames: number;
mediaStartsAt: number;
loop: boolean;
}) => {
if (!src) {
throw new Error('No src passed');
}
const parentSequence = useContext(SequenceContext);
const [initialVolume] = useState<VolumeProp | undefined>(() => volume);
const duration = getTimelineDuration({
compositionDurationInFrames: sequenceDurationInFrames,
playbackRate,
trimBefore,
trimAfter,
parentSequenceDurationInFrames: parentSequence?.durationInFrames ?? null,
loop,
});
const volumes: string | number = useMemo(() => {
if (typeof volume === 'number') {
return volume;View on GitHub (pinned to 78fe4bb3fd)
Solutions
- Gate the media element on src truthiness: `{url && <Video src={url} />}`.
- Initialize the URL state to a valid default asset instead of undefined.
- If src is computed, validate it before render and fall back to a placeholder composition.
- Check that imported asset paths resolve (e.g. `import vid from './vid.mp4'` is not undefined).
Example fix
// before
<Video src={videoUrl} />
// after
{videoUrl ? <Video src={videoUrl} /> : null} Defensive patterns
Strategy: validation
Validate before calling
if (!src || typeof src !== 'string' || src.trim() === '') {
return null; // or a placeholder
}
return <Video src={src} />; Type guard
const isValidSrc = (s: unknown): s is string => typeof s === 'string' && s.length > 0;
Prevention
- Never render <Audio>/<Video>/<Img> with an unguarded async src; gate on truthiness.
- Initialize source state to null and render the media element only once the URL resolves.
- Type your props so src is required (not optional) at the call site.
When it happens
Trigger: Rendering <Audio src={undefined} /> or <Video src={data.url} /> before data.url has loaded; passing an empty string src; destructuring src from a prop that was never provided; conditional media where the source field is optional and currently unset.
Common situations: Fetching a media URL asynchronously and rendering the <Video> before the fetch resolves; reading src from a CMS/props object where the field is empty; copy-paste leaving src off; environment differences where an asset path resolves to undefined.
Related errors
- No 'src' attribute was passed to the ${tagName} element.
- You have passed a volume of type ${typeof props.volume} to y
- You have passed a volume below 0 to your <${component} /> co
- You have passed a playbackRate of type ${typeof props.playba
- You have passed a playbackRate of ${props.playbackRate} to y
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/20d458d069f953d4.
Report an issue: GitHub.