remotion-dev/remotion · error · Error

`webFileReader` cannot read auxiliary files.

Error message

`webFileReader` cannot read auxiliary files.

What it means

Thrown unconditionally by webFileReadWholeAsText. The webFileReader has no mechanism to read auxiliary/adjacent text files because it only holds a single in-memory File/Blob with no filesystem relationship. Any parser feature requiring a sidecar text file is unsupported under this reader.

Source

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

			reader: streamReader,
			async abort() {
				try {
					await streamReader.cancel();
				} catch {}

				return Promise.resolve();
			},
		},
		contentLength: src.size,
		name: src instanceof File ? src.name : src.toString(),
		supportsContentRange: true,
		contentType: src.type,
		needsContentRange: true,
	});
};

export const webFileReadWholeAsText: ReadWholeAsText = () => {
	throw new Error('`webFileReader` cannot read auxiliary files.');
};

export const webFileCreateAdjacentFileSource: CreateAdjacentFileSource = () => {
	throw new Error('`webFileReader` cannot create adjacent file sources.');
};

export const webFileReader: MediaParserReaderInterface = {
	read: webFileReadContent,
	readWholeAsText: webFileReadWholeAsText,
	createAdjacentFileSource: webFileCreateAdjacentFileSource,
	preload: () => {
		// doing nothing, it's just for when fetching over the network
	},
};

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. If you need auxiliary files, switch to fetchReader (pass the URL of the main media so companions can be resolved relative to it) or nodeReader on the server.
  2. Bundle the companion data inline in the container so no external file is required.
  3. Drop the field that triggers auxiliary-file reads (e.g. captions) when using webFileReader, or provide the companion file through a different mechanism.

Example fix

// before
await parseMedia({ src: file, fields: { captions: true } }); // webFileReader

// after
await parseMedia({ src: fileUrl, srcType: 'fetch', fields: { captions: true } });
Defensive patterns

Strategy: fallback

Validate before calling

// webFileReader cannot read auxiliary files - validate the request shape
if (fields.captions && src instanceof Blob) { throw new TypeError('webFileReader cannot read auxiliary files; use fetchReader'); }

Type guard

const readerSupportsAuxText = (reader: string) => reader !== 'web-file';

Try / catch

try { await parseMedia({ src: file, fields: { captions: true } }); } catch (e) { if (/cannot read auxiliary files/.test(String((e as Error).message))) { await parseMedia({ src: url, srcType: 'fetch', fields: { captions: true } }); } else throw e; }

Prevention

When it happens

Trigger: Parsing a File/Blob with webFileReader and requesting fields or hitting a container that needs an adjacent text file (external subtitles, chapter files, sidecar metadata). The parser calls readWholeAsText, which always throws for webFileReader.

Common situations: Requesting captions/subtitles fields on an in-browser File whose track data lives in a separate .vtt. Container formats that reference companion files during parsing. Expecting Node-style adjacent-file resolution in the browser.

Related errors


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