{"record":{"id":"ac37df2530e1de7e","repo":"remotion-dev/remotion","slug":"outputrange-tuples-must-contain-at-least-1-number","errorCode":null,"errorMessage":"outputRange tuples must contain at least 1 number","messagePattern":"outputRange tuples must contain at least 1 number","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/core/src/interpolate.ts","lineNumber":961,"sourceCode":"\t\t}\n\t}\n\n\tconst range = findRange(resolvedInput, inputRange);\n\treturn resolvedInput >= inputRange[range + 1]\n\t\t? outputRange[range + 1]\n\t\t: outputRange[range];\n};\n\nconst validateTupleOutputRange = (\n\toutputRange: readonly (readonly unknown[])[],\n): number => {\n\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}","sourceCodeStart":943,"sourceCodeEnd":979,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/core/src/interpolate.ts#L943-L979","documentation":"Thrown by validateTupleOutputRange when the first tuple in outputRange has length 0. Each tuple must contribute at least one number to interpolate, so an empty tuple ([]) is rejected even though the array itself is non-empty.","triggerScenarios":"interpolate(t, [0, 1], [[], []]) or any outputRange of empty arrays. Also reachable by spreading an array of arrays that contains an empty sub-array.","commonSituations":"Building tuple outputRange programmatically and producing an empty tuple for some keyframe; mapping a source array that yields zero-length results.","solutions":["Give every tuple at least one number: [[0], [1]] or [[0,0], [1,1]].","Filter or assert non-empty tuples before calling interpolate()."],"exampleFix":"// before\ninterpolate(t, [0, 1], [[], []]);\n// after\ninterpolate(t, [0, 1], [[0], [1]]);","handlingStrategy":"validation","validationCode":"if (!outputRange.every((t) => Array.isArray(t) && t.length > 0)) {\n  throw new Error('Every tuple in outputRange must contain at least 1 number');\n}","typeGuard":"function isNonEmptyTuples(arr: readonly unknown[]): boolean {\n  return arr.every((t) => Array.isArray(t) && t.length > 0);\n}","tryCatchPattern":null,"preventionTips":["Ensure each tuple has at least one number.","When building tuples programmatically, filter out empty sub-arrays before calling interpolate()."],"tags":["interpolate","tuple","argument-shape","validation"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}