remotion-dev/remotion · error · Error
`webFileReader` cannot create adjacent file sources.
Error message
`webFileReader` cannot create adjacent file sources.
What it means
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.
Source
Thrown at packages/media-parser/src/readers/from-web-file.ts:57
} 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
- 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.
Example fix
// before
await parseMedia({ src: fileBlob, fields: {...} }); // needs adjacent file
// after
await parseMedia({ src: mediaUrl, srcType: 'fetch', fields: {...} }); Defensive patterns
Strategy: fallback
Validate before calling
// webFileReader cannot create adjacent sources - pre-check container needs
if (needsAdjacentSources(format) && src instanceof Blob) throw new TypeError('webFileReader cannot create adjacent sources; use fetchReader'); Type guard
const readerSupportsAdjacent = (reader: string) => reader !== 'web-file';
Try / catch
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; } Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- `webFileReader` cannot read auxiliary files.
- `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/99278ed3d189917c.
Report an issue: GitHub.