{"record":{"id":"cc984c94021fbabf","repo":"remotion-dev/remotion","slug":"outputrange-must-contain-only-numbers-numeric-tup","errorCode":null,"errorMessage":"outputRange must contain only numbers, numeric tuples, or supported scale, translate, and rotate strings","messagePattern":"outputRange must contain only numbers, numeric tuples, or supported scale, translate, and rotate strings","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/core/src/interpolate.ts","lineNumber":1223,"sourceCode":"\t\t\tif (!hasNonNumericString) {\n\t\t\t\tthrow error;\n\t\t\t}\n\n\t\t\treturn interpolateDiscreteString({\n\t\t\t\tinput,\n\t\t\t\tinputRange,\n\t\t\t\toutputRange,\n\t\t\t\toptions,\n\t\t\t});\n\t\t}\n\t}\n\n\tif (outputRange.every((output) => Array.isArray(output))) {\n\t\treturn interpolateTuple({input, inputRange, outputRange, options});\n\t}\n\n\tif (!outputRange.every((output) => typeof output === 'number')) {\n\t\tthrow new TypeError(\n\t\t\t'outputRange must contain only numbers, numeric tuples, or supported scale, translate, and rotate strings',\n\t\t);\n\t}\n\n\tcheckInfiniteRange('outputRange', outputRange);\n\n\treturn interpolateNumber({input, inputRange, outputRange, options});\n}\n/* eslint-enable no-redeclare */\n","sourceCodeStart":1205,"sourceCodeEnd":1233,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/core/src/interpolate.ts#L1205-L1233","documentation":"Thrown by interpolate() as the final fallback. After the string branch (no strings present) and the tuple branch (not all elements are arrays) are skipped, every remaining output must be a number; if any element is neither a number, a string, nor an array, this TypeError fires. It is the catch-all for outputRange contents the function cannot interpolate.","triggerScenarios":"interpolate(0,[0,1],[0, true]); interpolate(0,[0,1],[0, null]); interpolate(0,[0,1],[0, {x:1}]); a mixed array of numbers and booleans/objects.","commonSituations":"A conditional that injects a boolean into the array; an optional value rendered as null; partial data producing objects instead of numbers.","solutions":["Ensure outputRange contains only numbers (or only strings, or only tuples).","Map the array to coerce/replace non-numeric values before calling interpolate().","Filter out null/undefined entries so the array is homogeneous."],"exampleFix":"// before\nconst r = interpolate(t, [0, 1], [0, maybeAngle]); // maybeAngle can be null\n// after\nconst r = interpolate(t, [0, 1], [0, maybeAngle ?? 0]);","handlingStrategy":"validation","validationCode":"const allNum = outputRange.every((o) => typeof o === 'number');\nconst allStr = outputRange.every((o) => typeof o === 'string');\nconst allArr = outputRange.every((o) => Array.isArray(o));\nif (!(allNum || allStr || allArr)) {\n  throw new Error('outputRange must be homogeneous');\n}\nconst r = interpolate(input, inputRange, outputRange);","typeGuard":"const isHomogeneousRange = (x: unknown[]): boolean => {\n  const allNum = x.every((o) => typeof o === 'number');\n  const allStr = x.every((o) => typeof o === 'string');\n  const allArr = x.every((o) => Array.isArray(o));\n  return allNum || allStr || allArr;\n};","tryCatchPattern":null,"preventionTips":["Keep outputRange homogeneous: all numbers, all strings, or all tuples.","Filter null/undefined out of the array before the call.","Type the range to a single element kind so mismatches surface at compile time."],"tags":["interpolation","validation","output-range","type-error"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}