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
- Ensure src is a non-empty string | URL | File before calling parseMedia.
- Guard at the call site: `if (!src) throw new Error('src required')` with a clearer domain message.
- Log the src value just before the call when debugging integration code.
- 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
- Always validate src is non-empty at the call site with a domain-specific error.
- Make src a required function parameter (not optional) in your wrapper.
- Use TypeScript satisfies/strict types so missing src is a compile error.
- Log src provenance (uploader, env, config) to debug emptiness quickly.
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
- "${name}" must be greater than 0, but got ${JSON.stringify(v
- "${name}" must be greater than or equal to 0, but got ${JSON
- "colors" must be an array with at least 2 colors, but got ${
- "direction" must be ${formatEnum(ZIGZAG_DIRECTIONS)}, but go
- loadFont() requires an object as its argument, but received
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/679ed01defe6b56c.
Report an issue: GitHub.