{"record":{"id":"3e6236c1d05529b3","repo":"remotion-dev/remotion","slug":"outputrange-can-not-be-undefined-3e6236","errorCode":null,"errorMessage":"outputRange can not be undefined","messagePattern":"outputRange can not be undefined","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/core/src/interpolate-colors.ts","lineNumber":709,"sourceCode":" * @description Allows you to map a range of values to colors using a concise syntax.\n * @see [Documentation](https://remotion.dev/docs/interpolate-colors)\n */\nexport const interpolateColors = (\n\tinput: number,\n\tinputRange: readonly number[],\n\toutputRange: readonly string[],\n\toptions?: InterpolateColorsOptions,\n): string => {\n\tif (typeof input === 'undefined') {\n\t\tthrow new TypeError('input can not be undefined');\n\t}\n\n\tif (typeof inputRange === 'undefined') {\n\t\tthrow new TypeError('inputRange can not be undefined');\n\t}\n\n\tif (typeof outputRange === 'undefined') {\n\t\tthrow new TypeError('outputRange can not be undefined');\n\t}\n\n\tif (inputRange.length !== outputRange.length) {\n\t\tthrow new TypeError(\n\t\t\t'inputRange (' +\n\t\t\t\tinputRange.length +\n\t\t\t\t' values provided) and outputRange (' +\n\t\t\t\toutputRange.length +\n\t\t\t\t' values provided) must have the same length',\n\t\t);\n\t}\n\n\tconst processedOutputRange = outputRange.map((c) => processColor(c));\n\n\treturn interpolateColorsRGB(input, inputRange, processedOutputRange, options);\n};\n","sourceCodeStart":691,"sourceCodeEnd":726,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/core/src/interpolate-colors.ts#L691-L726","documentation":"Thrown by interpolateColors when the `outputRange` argument is undefined. Like inputRange, the output color range is required to perform the mapping.","triggerScenarios":"Calling interpolateColors(input, inputRange, undefined) — usually because outputRange came from a missing field or an empty map/filter that returned undefined.","commonSituations":"Dynamic color arrays sourced from config or props that may be absent; copy-paste omitting the third argument.","solutions":["Pass an explicit outputRange of color strings, e.g. ['#000', '#fff'].","Default it where optional: outputRange ?? ['red', 'green'].","Annotate the source type so the omission surfaces at compile time."],"exampleFix":"// before\ninterpolateColors(frame, [0, 100], colors); // colors undefined\n\n// after\ninterpolateColors(frame, [0, 100], colors ?? ['#ff0000', '#00ff00']);","handlingStrategy":"type-guard","validationCode":"if (!Array.isArray(outputRange) || outputRange.length === 0) {\n  throw new TypeError('interpolateColors: outputRange must be a non-empty string[]');\n}\ninterpolateColors(input, inputRange, outputRange);","typeGuard":"const isStringArray = (v: unknown): v is readonly string[] => Array.isArray(v) && v.every((s) => typeof s === 'string');","tryCatchPattern":null,"preventionTips":["Pass an explicit outputRange of color strings.","Default it where optional (outputRange ?? ['#000', '#fff']).","Type the source so omissions surface at compile time."],"tags":["color","interpolate","validation","undefined"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}