{"record":{"id":"aea03c1358989e1b","repo":"remotion-dev/remotion","slug":"outputrange-tuples-must-contain-only-finite-number","errorCode":null,"errorMessage":"outputRange tuples must contain only finite numbers, but got [${output.join(',')}]","messagePattern":"outputRange tuples must contain only finite numbers, but got \\[(.+?)\\]","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/core/src/interpolate.ts","lineNumber":973,"sourceCode":"\tconst dimensions = outputRange[0]?.length;\n\tif (dimensions === undefined) {\n\t\tthrow new Error('outputRange must have at least 1 element');\n\t}\n\n\tif (dimensions === 0) {\n\t\tthrow new TypeError('outputRange tuples must contain at least 1 number');\n\t}\n\n\tfor (const output of outputRange) {\n\t\tif (output.length !== dimensions) {\n\t\t\tthrow new TypeError(\n\t\t\t\t`outputRange tuples must all have the same length, but got ${dimensions} and ${output.length}`,\n\t\t\t);\n\t\t}\n\n\t\tfor (const value of output) {\n\t\t\tif (typeof value !== 'number' || !Number.isFinite(value)) {\n\t\t\t\tthrow new TypeError(\n\t\t\t\t\t`outputRange tuples must contain only finite numbers, but got [${output.join(\n\t\t\t\t\t\t',',\n\t\t\t\t\t)}]`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn dimensions;\n};\n\nconst interpolateTuple = ({\n\tinput,\n\tinputRange,\n\toutputRange,\n\toptions,\n}: {\n\tinput: number;","sourceCodeStart":955,"sourceCodeEnd":991,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/core/src/interpolate.ts#L955-L991","documentation":"Thrown by validateTupleOutputRange when interpolate() is called with a multi-dimensional (tuple) outputRange. The validator walks every value inside every tuple and rejects any element that is not a finite number. NaN, Infinity, -Infinity, strings, null, and undefined inside a tuple all trigger it.","triggerScenarios":"Calling interpolate() whose outputRange is an array of arrays, where at least one inner tuple contains a non-number or a non-finite number. Examples: interpolate(0, [0,1], [[0,'px'],[100,'px']]); interpolate(0,[0,1],[[0,NaN],[1,2]]); interpolate(0,[0,1],[[0,null],[1,2]]).","commonSituations":"Animating 2D positions, scale pairs, or matrix-like values via tuple output, but accidentally leaving string units ('px','%') inside the tuples, or computing a tuple element from a division that yields NaN/Infinity.","solutions":["Strip any unit strings from tuple elements; tuples only take raw numbers.","Check every tuple element with Number.isFinite() before calling interpolate().","Find the source of NaN/Infinity (e.g. division by zero, Math.log of a non-positive) in the code that builds the tuple."],"exampleFix":"// before\nconst x = interpolate(t, [0, 1], [[0, 'px'], [100, 'px']]);\n// after\nconst x = interpolate(t, [0, 1], [[0, 0], [100, 0]]);","handlingStrategy":"validation","validationCode":"const isFiniteTuple = (t: unknown): t is number[] =>\n  Array.isArray(t) && t.every((v) => typeof v === 'number' && Number.isFinite(v));\n\nif (!outputRange.every(isFiniteTuple)) {\n  throw new Error('outputRange tuples must be finite number arrays');\n}\nconst r = interpolate(input, inputRange, outputRange as number[][]);","typeGuard":"const isFiniteTupleArray = (x: unknown): x is number[][] =>\n  Array.isArray(x) && x.every((t) => Array.isArray(t) && t.every((v) => typeof v === 'number' && Number.isFinite(v)));","tryCatchPattern":null,"preventionTips":["Type outputRange as number[][] so non-number tuple members fail at compile time.","Build tuple outputs from already-validated number sources.","Never put CSS unit strings inside tuples; use the string-output path for units."],"tags":["interpolation","validation","tuples","type-error"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}