remotion-dev/remotion · error · Error

`inputTypeFileReader` only supports `File` objects

Error message

`inputTypeFileReader` only supports `File` objects

What it means

Thrown by webFileReadContent when src is a string or URL. The webFileReader is designed exclusively for File/Blob objects and uses Blob.prototype.slice/.stream, which do not exist on strings or URLs. Passing a URL/string indicates the wrong reader was selected.

Source

Thrown at packages/media-parser/src/readers/from-web-file.ts:10

import type {
	CreateAdjacentFileSource,
	MediaParserReaderInterface,
	ReadContent,
	ReadWholeAsText,
} from './reader';

export const webFileReadContent: ReadContent = ({src, range, controller}) => {
	if (typeof src === 'string' || src instanceof URL) {
		throw new Error('`inputTypeFileReader` only supports `File` objects');
	}

	const part =
		range === null
			? src
			: typeof range === 'number'
				? src.slice(range)
				: src.slice(range[0], range[1] + 1);

	const stream = part.stream();
	const streamReader = stream.getReader();

	if (controller) {
		controller._internals.signal.addEventListener(
			'abort',
			() => {
				streamReader.cancel();
			},

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Use fetchReader for http(s) URL strings and URL objects.
  2. If you have a File from <input type=file>, keep webFileReader; do not pass object URLs to it.
  3. If you only have an object URL string, fetch it into a Blob first, or switch the reader to fetchReader.

Example fix

// before
await parseMedia({ src: 'https://.../video.mp4', fields: {...} }); // web-file reader

// after
await parseMedia({ src: 'https://.../video.mp4', srcType: 'fetch', fields: {...} });
Defensive patterns

Strategy: validation

Validate before calling

if (typeof src === 'string' || src instanceof URL) throw new TypeError('webFileReader requires a File/Blob');
await parseMedia({ src, srcType: 'web-file', fields });

Type guard

const isFileOrBlob = (s: unknown): s is Blob => typeof Blob !== 'undefined' && s instanceof Blob;

Try / catch

try { await parseMedia({ src, srcType: 'web-file', fields }); } catch (e) { if (/only supports `File` objects/.test(String((e as Error).message))) { /* switch to fetchReader */ } else throw e; }

Prevention

When it happens

Trigger: Calling parseMedia with srcType 'web-file' (or webFileReader) while passing a URL string or object URL instead of a File/Blob. The reader immediately rejects because it cannot slice/stream a string.

Common situations: Selecting inputTypeFileReader/webFileReader for a remote URL instead of fetchReader. Forgetting to wrap a fetched response body into a Blob. Mixing up srcType values when porting between local-file and remote-URL code paths.

Related errors


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