{"record":{"id":"f7106f99d3df6703","repo":"remotion-dev/remotion","slug":"file-does-not-exist-src","errorCode":null,"errorMessage":"File does not exist: ${src}","messagePattern":"File does not exist: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/media-parser/src/readers/from-node.ts","lineNumber":25,"sourceCode":"\tReadWholeAsText,\n} from './reader';\n\nexport const nodeReadContent: ReadContent = async ({\n\tsrc,\n\trange,\n\tcontroller,\n}) => {\n\tif (typeof src !== 'string') {\n\t\tthrow new Error('src must be a string when using `nodeReader`');\n\t}\n\n\tawait Promise.resolve();\n\n\tconst ownController = new AbortController();\n\n\ttry {\n\t\tif (!existsSync(src)) {\n\t\t\tthrow new Error(`File does not exist: ${src}`);\n\t\t}\n\n\t\tconst stream = createReadStream(src, {\n\t\t\tstart: range === null ? 0 : typeof range === 'number' ? range : range[0],\n\t\t\tend:\n\t\t\t\trange === null\n\t\t\t\t\t? Infinity\n\t\t\t\t\t: typeof range === 'number'\n\t\t\t\t\t\t? Infinity\n\t\t\t\t\t\t: range[1],\n\t\t});\n\n\t\tcontroller._internals.signal.addEventListener(\n\t\t\t'abort',\n\t\t\t() => {\n\t\t\t\townController.abort();\n\t\t\t},\n\t\t\t{once: true},","sourceCodeStart":7,"sourceCodeEnd":43,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/media-parser/src/readers/from-node.ts#L7-L43","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Log and verify the absolute path with fs.accessSync(path, fs.constants.R_OK) right before parseMedia.","Resolve relative paths against a known root: path.resolve(__dirname, relative).","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."],"exampleFix":"// before\nawait parseMedia({ src: './input/video.mp4', fields: {...} }); // wrong cwd\n\n// after\nimport path from 'node:path';\nconst src = path.resolve(process.cwd(), 'input', 'video.mp4');\nfs.accessSync(src, fs.constants.R_OK);\nawait parseMedia({ src, fields: {...} });","handlingStrategy":"validation","validationCode":"import { accessSync, constants } from 'node:fs';\nfunction assertReadable(p: string) { accessSync(p, constants.R_OK); }\nassertReadable(src);","typeGuard":"const fileExists = (p: string) => { try { accessSync(p); return true; } catch { return false; } };","tryCatchPattern":"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; }","preventionTips":["Always resolve relative paths against a known root with path.resolve.","Stage media into a stable temp directory you control during rendering.","Log the absolute path before parsing when debugging missing-file errors."],"tags":["media-parser","reader","node","filesystem","missing-file"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}