{"record":{"id":"0d3f3285ef3a2c1b","repo":"remotion-dev/remotion","slug":"outputlocation-must-not-be-an-empty-string","errorCode":null,"errorMessage":"outputLocation must not be an empty string","messagePattern":"outputLocation must not be an empty string","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cli/src/config/output-location.ts","lineNumber":13,"sourceCode":"let currentOutputLocation: string | null = null;\n\nexport const setOutputLocation = (newOutputLocation: string) => {\n\tif (typeof newOutputLocation !== 'string') {\n\t\tthrow new Error(\n\t\t\t`outputLocation must be a string but got ${typeof newOutputLocation} (${JSON.stringify(\n\t\t\t\tnewOutputLocation,\n\t\t\t)})`,\n\t\t);\n\t}\n\n\tif (newOutputLocation.trim() === '') {\n\t\tthrow new Error(`outputLocation must not be an empty string`);\n\t}\n\n\tcurrentOutputLocation = newOutputLocation;\n};\n\nexport const getOutputLocation = () => currentOutputLocation;\n\nexport const resetOutputLocation = () => {\n\tcurrentOutputLocation = null;\n};\n","sourceCodeStart":1,"sourceCodeEnd":24,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/cli/src/config/output-location.ts#L1-L24","documentation":"`Config.setOutputLocation()` rejects empty/whitespace-only strings with a dedicated error after the type check. The trim check at output-location.ts:12 means even `'   '` is rejected, not just `''`.","triggerScenarios":"Calling `Config.setOutputLocation('')` or `Config.setOutputLocation('   ')`. Also triggered when an env var is set but blank (`OUT= remotion render ...`).","commonSituations":"Empty env var (`OUT=`); template literal that resolved to nothing (`Config.setOutputLocation(`out/${name}.mp4`)` with `name` undefined); trimmed user input from a form.","solutions":["Provide a real path, e.g. `Config.setOutputLocation('out/video.mp4')`.","When the source may be blank, fall back to a default: `Config.setOutputLocation(process.env.OUT?.trim() || 'out/video.mp4')`."],"exampleFix":"// before\nConfig.setOutputLocation(process.env.OUT || '');\n// after\nConfig.setOutputLocation(process.env.OUT?.trim() || 'out/video.mp4');","handlingStrategy":"validation","validationCode":"const raw = (process.env.OUT ?? '').trim();\nif (raw === '') {\n  throw new Error('OUT must not be empty');\n}\nConfig.setOutputLocation(raw);","typeGuard":"const isNonEmptyString = (v: unknown): v is string =>\n  typeof v === 'string' && v.trim().length > 0;","tryCatchPattern":null,"preventionTips":["Trim and check env-derived strings before passing them to setters.","Fail loud in CI when required env vars are missing rather than defaulting to ''."],"tags":["config","validation","output"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}