remotion-dev/remotion · error · Error

File does not exist: ${src}

Error message

File does not exist: ${src}

What it means

Thrown by nodeReadContent after fs.existsSync(src) returns false, before opening a read stream. The Node reader refuses to operate on a path that does not exist on disk. This is an early, explicit failure rather than a downstream ENOENT from createReadStream.

Source

Thrown at packages/media-parser/src/readers/from-node.ts:25

	ReadWholeAsText,
} from './reader';

export const nodeReadContent: ReadContent = async ({
	src,
	range,
	controller,
}) => {
	if (typeof src !== 'string') {
		throw new Error('src must be a string when using `nodeReader`');
	}

	await Promise.resolve();

	const ownController = new AbortController();

	try {
		if (!existsSync(src)) {
			throw new Error(`File does not exist: ${src}`);
		}

		const stream = createReadStream(src, {
			start: range === null ? 0 : typeof range === 'number' ? range : range[0],
			end:
				range === null
					? Infinity
					: typeof range === 'number'
						? Infinity
						: range[1],
		});

		controller._internals.signal.addEventListener(
			'abort',
			() => {
				ownController.abort();
			},
			{once: true},

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Log and verify the absolute path with fs.accessSync(path, fs.constants.R_OK) right before parseMedia.
  2. Resolve relative paths against a known root: path.resolve(__dirname, relative).
  3. Ensure the file is staged on the same filesystem the parser runs on (copy into the Lambda task directory or tmp dir) and that nothing deletes it before parsing completes.

Example fix

// before
await parseMedia({ src: './input/video.mp4', fields: {...} }); // wrong cwd

// after
import path from 'node:path';
const src = path.resolve(process.cwd(), 'input', 'video.mp4');
fs.accessSync(src, fs.constants.R_OK);
await parseMedia({ src, fields: {...} });
Defensive patterns

Strategy: validation

Validate before calling

import { accessSync, constants } from 'node:fs';
function assertReadable(p: string) { accessSync(p, constants.R_OK); }
assertReadable(src);

Type guard

const fileExists = (p: string) => { try { accessSync(p); return true; } catch { return false; } };

Try / catch

try { await parseMedia({ src, srcType: 'node', fields }); } catch (e) { if (/File does not exist/.test(String((e as Error).message))) { /* re-stage the file, resolve absolute path, retry */ } else throw e; }

Prevention

When it happens

Trigger: Calling parseMedia with nodeReader and a path string that is misspelled, relative to the wrong working directory, deleted, or on a different volume/mount. Also triggered when a path was valid at scheduling time but the file was removed before parsing.

Common situations: Passing a path relative to the source file rather than process.cwd() during Lambda/serverless rendering where the working directory differs. Referencing a temp file that was already garbage-collected. Path casing or trailing-slash mistakes on case-sensitive Linux render workers.

Related errors


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