{"record":{"id":"2153a8c360f78d54","repo":"remotion-dev/remotion","slug":"webfilereader-cannot-read-auxiliary-files","errorCode":null,"errorMessage":"`webFileReader` cannot read auxiliary files.","messagePattern":"`webFileReader` cannot read auxiliary files\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/media-parser/src/readers/from-web-file.ts","lineNumber":53,"sourceCode":"\t\t\treader: streamReader,\n\t\t\tasync abort() {\n\t\t\t\ttry {\n\t\t\t\t\tawait streamReader.cancel();\n\t\t\t\t} catch {}\n\n\t\t\t\treturn Promise.resolve();\n\t\t\t},\n\t\t},\n\t\tcontentLength: src.size,\n\t\tname: src instanceof File ? src.name : src.toString(),\n\t\tsupportsContentRange: true,\n\t\tcontentType: src.type,\n\t\tneedsContentRange: true,\n\t});\n};\n\nexport const webFileReadWholeAsText: ReadWholeAsText = () => {\n\tthrow new Error('`webFileReader` cannot read auxiliary files.');\n};\n\nexport const webFileCreateAdjacentFileSource: CreateAdjacentFileSource = () => {\n\tthrow new Error('`webFileReader` cannot create adjacent file sources.');\n};\n\nexport const webFileReader: MediaParserReaderInterface = {\n\tread: webFileReadContent,\n\treadWholeAsText: webFileReadWholeAsText,\n\tcreateAdjacentFileSource: webFileCreateAdjacentFileSource,\n\tpreload: () => {\n\t\t// doing nothing, it's just for when fetching over the network\n\t},\n};\n","sourceCodeStart":35,"sourceCodeEnd":68,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/media-parser/src/readers/from-web-file.ts#L35-L68","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\nawait parseMedia({ src: file, fields: { captions: true } }); // webFileReader\n\n// after\nawait parseMedia({ src: fileUrl, srcType: 'fetch', fields: { captions: true } });","handlingStrategy":"fallback","validationCode":"// webFileReader cannot read auxiliary files - validate the request shape\nif (fields.captions && src instanceof Blob) { throw new TypeError('webFileReader cannot read auxiliary files; use fetchReader'); }","typeGuard":"const readerSupportsAuxText = (reader: string) => reader !== 'web-file';","tryCatchPattern":"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; }","preventionTips":["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."],"tags":["media-parser","reader","web-file","auxiliary-files","unsupported"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}