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
- 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.
- Bundle the companion data inline in the container so no external file is required.
- 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
- Do not request caption/auxiliary fields when parsing an isolated Blob.
- Use fetchReader when companion text files are required.
- Bundle subtitles inline to avoid auxiliary reads.
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
- `webFileReader` cannot create adjacent file sources.
- `inputTypeFileReader` only supports `File` objects
- Not enough bytes left to parse EBML - this should not happen
- has no bytes
- `reader` should not be provided to `${apiName}`. If you want
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/2153a8c360f78d54.
Report an issue: GitHub.