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

  1. Gate the media element on src truthiness: `{url && <Video src={url} />}`.
  2. Initialize the URL state to a valid default asset instead of undefined.
  3. If src is computed, validate it before render and fall back to a placeholder composition.
  4. 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

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


AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12). Data as JSON: /api/errors/20d458d069f953d4. Report an issue: GitHub.