{"record":{"id":"c85dc187e7aa449f","repo":"remotion-dev/remotion","slug":"outputs-layer-outputtarget-must-be-arraybuffer","errorCode":null,"errorMessage":"outputs.${layer}.outputTarget must be arraybuffer or web-fs.","messagePattern":"outputs\\.(.+?)\\.outputTarget must be arraybuffer or web-fs\\.","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/video-matting/src/separate-video-layers.ts","lineNumber":123,"sourceCode":"\toutput,\n}: {\n\tlayer: 'base' | 'foreground';\n\toutput: VideoLayerOutputOptions | undefined;\n}) => {\n\tif (output === undefined) {\n\t\treturn;\n\t}\n\n\tif (!output || typeof output !== 'object' || Array.isArray(output)) {\n\t\tthrow new TypeError(`outputs.${layer} must be an object.`);\n\t}\n\n\tif (\n\t\toutput.outputTarget !== undefined &&\n\t\toutput.outputTarget !== 'arraybuffer' &&\n\t\toutput.outputTarget !== 'web-fs'\n\t) {\n\t\tthrow new TypeError(\n\t\t\t`outputs.${layer}.outputTarget must be arraybuffer or web-fs.`,\n\t\t);\n\t}\n\n\tif (\n\t\toutput.outputTarget !== undefined &&\n\t\toutput.outputWritable !== undefined\n\t) {\n\t\tthrow new TypeError(\n\t\t\t`outputs.${layer} cannot specify both outputTarget and outputWritable.`,\n\t\t);\n\t}\n\n\tif (output.outputWritable !== undefined) {\n\t\tif (\n\t\t\ttypeof WritableStream === 'undefined' ||\n\t\t\t!(output.outputWritable instanceof WritableStream)\n\t\t) {","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/remotion-dev/remotion/blob/b2f4e34732f3c6c222ea029413e22dc402218cd7/packages/video-matting/src/separate-video-layers.ts#L105-L141","documentation":"Each layer output's outputTarget field, if present, must be exactly 'arraybuffer' or 'web-fs'. Any other value (including other string targets or wrong types) is rejected with this TypeError so the library only commits to output sinks it supports.","triggerScenarios":"Passing {outputTarget: 'file'}, {outputTarget: 'blob'}, {outputTarget: 'stream'}, or a non-string value in a layer's output config.","commonSituations":"Copy-pasting target names from another library's API; assuming Node-style 'file' targets work in the browser build; typos like 'arrayBuffer' (wrong case).","solutions":["Set outputTarget to 'arraybuffer' to receive an ArrayBuffer result.","Set outputTarget to 'web-fs' to write via the File System Access API.","Fix casing/typos ('arraybuffer' is all-lowercase).","Use outputWritable instead if you want to pipe into your own sink."],"exampleFix":"// before\noutputs: {video: {outputTarget: 'file'}}\n// after\noutputs: {video: {outputTarget: 'arraybuffer'}}","handlingStrategy":"type-guard","validationCode":"const VALID = ['arraybuffer', 'web-fs'] as const;\nif (out.outputTarget !== undefined && !VALID.includes(out.outputTarget)) throw new TypeError('bad outputTarget');","typeGuard":"const isOutputTarget = (v: unknown): v is 'arraybuffer' | 'web-fs' => v === 'arraybuffer' || v === 'web-fs';","tryCatchPattern":"try { await separateVideoLayers(opts); } catch (e) { if (e instanceof TypeError && e.message.includes('outputTarget')) { console.error('outputTarget must be arraybuffer or web-fs'); } throw e; }","preventionTips":["Only use the two documented target strings","Watch for casing mistakes ('arrayBuffer' is invalid)","Prefer a typed union so invalid strings fail at compile time"],"tags":["typeerror","validation","enum"],"backgroundTag":"invalid-enum-value","analyzedSha":"b2f4e34732f3c6c222ea029413e22dc402218cd7","analyzedAt":"2026-09-09T13:27:51.281Z","contentChangedAt":"2026-09-09T13:27:51.281Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}