remotion-dev/remotion · error · Error

No "src" provided

Error message

No "src" provided

What it means

internalParseMedia destructures src from its options and immediately throws if it is falsy. This is the earliest guard before any reader is constructed: the library cannot fetch, open, or stream anything without a source. src may be a string URL, a URL object, or a File.

Source

Thrown at packages/media-parser/src/internal-parse-media.ts:48

	onVideoTrack,
	controller = mediaParserController(),
	logLevel,
	onParseProgress: onParseProgressDoNotCallDirectly,
	progressIntervalInMs,
	mode,
	onDiscardedData,
	onError,
	acknowledgeRemotionLicense,
	apiName,
	selectM3uStream: selectM3uStreamFn,
	selectM3uAssociatedPlaylists: selectM3uAssociatedPlaylistsFn,
	m3uPlaylistContext,
	makeSamplesStartAtZero,
	seekingHints,
	...more
}: InternalParseMediaOptions<F>) {
	if (!src) {
		throw new Error('No "src" provided');
	}

	controller._internals.markAsReadyToEmitEvents();
	warnIfRemotionLicenseNotAcknowledged({
		acknowledgeRemotionLicense,
		logLevel,
		apiName,
	});

	Log.verbose(
		logLevel,
		`Reading ${typeof src === 'string' ? src : src instanceof URL ? src.toString() : src instanceof File ? src.name : src.toString()}`,
	);

	const prefetchCache = new Map<string, ReturnType<typeof makeFetchRequest>>();

	const {
		reader: readerInstance,

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Ensure src is a non-empty string | URL | File before calling parseMedia.
  2. Guard at the call site: `if (!src) throw new Error('src required')` with a clearer domain message.
  3. Log the src value just before the call when debugging integration code.
  4. Add a TypeScript satisfies on the options object so a missing src is caught at compile time.

Example fix

// before
await parseMedia({fields: {durationInSeconds: true}}); // src forgotten

// after
if (!url) throw new Error('Cannot parse: no media URL provided by uploader');
await parseMedia({src: url, fields: {durationInSeconds: true}});
Defensive patterns

Strategy: validation

Validate before calling

function assertSrc(src: unknown): asserts src is string | URL | File {
  if (!src || (typeof src !== 'string' && !(src instanceof URL) && !(src instanceof File))) {
    throw new Error('parseMedia requires a non-empty src (string | URL | File)');
  }
}
assertSrc(url);
await parseMedia({src: url, fields: {}});

Type guard

const isValidSrc = (src: unknown): src is string | URL | File =>
  typeof src === 'string' ? src.length > 0 : src instanceof URL || src instanceof File;

Try / catch

if (!url) throw new Error('Cannot start parse: uploader returned no URL');
try {
  await parseMedia({src: url, fields: {durationInSeconds: true}});
} catch (e) {
  if (e instanceof Error && e.message === 'No "src" provided') {
    throw new Error('Internal: src became falsy before parse');
  }
  throw e;
}

Prevention

When it happens

Trigger: Calling parseMedia (or parseMediaOnWorker) with src omitted, set to undefined/null, an empty string '', or 0. Common when src is computed from a variable that was never assigned.

Common situations: Form/upload flows where the file URL is empty until upload finishes, env-driven configs where the URL var is missing in one environment, or refactors that rename the field but leave callers passing the old name.

Related errors


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