{"record":{"id":"99278ed3d189917c","repo":"remotion-dev/remotion","slug":"webfilereader-cannot-create-adjacent-file-source","errorCode":null,"errorMessage":"`webFileReader` cannot create adjacent file sources.","messagePattern":"`webFileReader` cannot create adjacent file sources\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/media-parser/src/readers/from-web-file.ts","lineNumber":57,"sourceCode":"\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":39,"sourceCodeEnd":68,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/media-parser/src/readers/from-web-file.ts#L39-L68","documentation":"Thrown unconditionally by webFileCreateAdjacentFileSource. The webFileReader cannot resolve adjacent file sources because a File/Blob has no associated base URL or directory; only the single blob is available. Any attempt to compute a companion resource path under this reader fails by design.","triggerScenarios":"Parsing with webFileReader when the container format requests an adjacent/external file source (e.g. external moov atom, alternate track, sidecar asset). createAdjacentFileSource is invoked and always throws.","commonSituations":"Browser upload-and-parse flows where the container references external assets. Moov-relocation or fragmented-mp4 variants that point to sibling files. Using webFileReader for a media type that fundamentally needs companion files.","solutions":["Use fetchReader with the media's URL so adjacent sources can be resolved relative to that URL.","On the server, use nodeReader so adjacent files resolve relative to dirname(src).","Re-encode the media to be self-contained (inline tracks/moov) so no adjacent source is needed."],"exampleFix":"// before\nawait parseMedia({ src: fileBlob, fields: {...} }); // needs adjacent file\n\n// after\nawait parseMedia({ src: mediaUrl, srcType: 'fetch', fields: {...} });","handlingStrategy":"fallback","validationCode":"// webFileReader cannot create adjacent sources - pre-check container needs\nif (needsAdjacentSources(format) && src instanceof Blob) throw new TypeError('webFileReader cannot create adjacent sources; use fetchReader');","typeGuard":"const readerSupportsAdjacent = (reader: string) => reader !== 'web-file';","tryCatchPattern":"try { await parseMedia({ src: file, fields }); } catch (e) { if (/cannot create adjacent file sources/.test(String((e as Error).message))) { await parseMedia({ src: url, srcType: 'fetch', fields }); } else throw e; }","preventionTips":["Use fetchReader or nodeReader when the container references adjacent assets.","Re-encode media to be self-contained where possible.","Detect adjacent-file requirements upstream and choose the reader accordingly."],"tags":["media-parser","reader","web-file","adjacent-files","unsupported"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}