{"record":{"id":"4c78926787ab7b4a","repo":"remotion-dev/remotion","slug":"outputrange-can-not-be-undefined-4c7892","errorCode":null,"errorMessage":"outputRange can not be undefined","messagePattern":"outputRange can not be undefined","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/src/interpolate.ts","lineNumber":1148,"sourceCode":"\toutputRange: readonly (number | string | readonly number[])[],\n\toptions?: InterpolateOptions,\n): number | string | readonly number[];\nexport function interpolate(\n\tinput: number,\n\tinputRange: readonly number[],\n\toutputRange: readonly InterpolateOutputValue[],\n\toptions?: InterpolateOptions,\n): number | string | readonly number[] {\n\tif (typeof input === 'undefined') {\n\t\tthrow new Error('input can not be undefined');\n\t}\n\n\tif (typeof inputRange === 'undefined') {\n\t\tthrow new Error('inputRange can not be undefined');\n\t}\n\n\tif (typeof outputRange === 'undefined') {\n\t\tthrow new Error('outputRange can not be undefined');\n\t}\n\n\tif (inputRange.length !== outputRange.length) {\n\t\tthrow new Error(\n\t\t\t'inputRange (' +\n\t\t\t\tinputRange.length +\n\t\t\t\t') and outputRange (' +\n\t\t\t\toutputRange.length +\n\t\t\t\t') must have the same length',\n\t\t);\n\t}\n\n\tcheckInfiniteRange('inputRange', inputRange);\n\tcheckValidInputRange(inputRange);\n\n\tassertValidInterpolateEasingOption(options?.easing, inputRange.length);\n\tassertValidInterpolatePosterizeOption(options?.posterize);\n\tassertValidInterpolateOutputOption(options?.output);","sourceCodeStart":1130,"sourceCodeEnd":1166,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/core/src/interpolate.ts#L1130-L1166","documentation":"Thrown at the top of interpolate() when the outputRange argument is undefined. Checked right after the inputRange guard, before length comparison, so the failure points clearly at the missing outputRange rather than at a downstream null-deref.","triggerScenarios":"interpolate(0, [0,1], undefined); passing an outputRange variable that was never initialized; reading a missing array field from props/config.","commonSituations":"Forgetting to pass outputRange; building it conditionally and hitting the empty branch; destructuring a prop that does not exist.","solutions":["Always supply a defined outputRange array.","Default the variable to a valid output literal when it may be undefined.","Add a runtime guard that returns early when outputRange is missing."],"exampleFix":"// before\nconst r = interpolate(t, [0, 1], out); // out is undefined\n// after\nconst r = interpolate(t, [0, 1], out ?? [0, 100]);","handlingStrategy":"validation","validationCode":"if (!Array.isArray(outputRange)) {\n  throw new Error('outputRange is required');\n}\nconst r = interpolate(input, inputRange, outputRange);","typeGuard":"const isOutputArray = (x: unknown): x is readonly unknown[] =>\n  Array.isArray(x);","tryCatchPattern":null,"preventionTips":["Always pass outputRange as an array literal.","Default the variable to [0, 1] when it may be undefined.","Return early from the caller when outputRange is missing."],"tags":["interpolation","validation","output-range"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}