{"record":{"id":"261abb14688f51bc","repo":"remotion-dev/remotion","slug":"outputrange-must-contain-only-finite-numbers-but","errorCode":null,"errorMessage":"outputRange must contain only finite numbers, but got [${output}]","messagePattern":"outputRange must contain only finite numbers, but got \\[(.+?)\\]","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/src/interpolate.ts","lineNumber":422,"sourceCode":"\tif (vectorAngle.kind !== 'rotate') {\n\t\treturn null;\n\t}\n\n\treturn {\n\t\tkind: 'rotate',\n\t\tvalues: [axis[0], axis[1], axis[2], vectorAngle.value],\n\t\tunits: [null, null, null, vectorAngle.unit],\n\t\tdimensions: 4,\n\t\taxisRotation: true,\n\t};\n};\n\nconst parseStringInterpolationValue = (\n\toutput: string | number,\n): ParsedStringInterpolationValue => {\n\tif (typeof output === 'number') {\n\t\tif (!Number.isFinite(output)) {\n\t\t\tthrow new Error(\n\t\t\t\t`outputRange must contain only finite numbers, but got [${output}]`,\n\t\t\t);\n\t\t}\n\n\t\treturn {\n\t\t\tkind: 'scale',\n\t\t\tvalues: [output, output, 1, 0],\n\t\t\tunits: [null, null, null, null],\n\t\t\tdimensions: 1,\n\t\t\taxisRotation: false,\n\t\t};\n\t}\n\n\tconst axisRotation = parseAxisRotationValue(output);\n\tif (axisRotation !== null) {\n\t\treturn axisRotation;\n\t}\n","sourceCodeStart":404,"sourceCodeEnd":440,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/core/src/interpolate.ts#L404-L440","documentation":"Thrown by parseStringInterpolationValue when an outputRange element is a JS number that is not finite (NaN, Infinity, -Infinity). When interpolate() detects at least one string in outputRange it routes every element through this parser; a non-finite number is invalid because there is no meaningful interpolation target for it.","triggerScenarios":"interpolate(input, inputRange, outputRange) where outputRange mixes strings with a non-finite number, e.g. [\"0px\", Infinity], [\"scale(1)\", NaN], or a value computed via division by zero.","commonSituations":"Dividing by zero or parsing bad input upstream and feeding the result into a mixed string/number outputRange; spreading an array that accidentally contains NaN.","solutions":["Sanitize the number with Number.isFinite before adding it to outputRange.","Replace the non-finite value with a finite endpoint or use clamp on the source calculation."],"exampleFix":"// before\ninterpolate(t, [0, 1], [\"0px\", Infinity]);\n// after\ninterpolate(t, [0, 1], [\"0px\", Number.isFinite(max) ? max : 1000]);","handlingStrategy":"validation","validationCode":"function allFiniteOutputs(outputRange: readonly (string | number)[]): boolean {\n  return outputRange.every((o) => typeof o === 'string' || Number.isFinite(o));\n}\n\nif (!allFiniteOutputs(outputRange)) {\n  throw new Error('outputRange contains a non-finite number');\n}","typeGuard":"function isFiniteOutputRange(range: readonly (string | number)[]): range is readonly (string | number)[] {\n  return range.every((o) => typeof o === 'string' || (typeof o === 'number' && Number.isFinite(o)));\n}","tryCatchPattern":null,"preventionTips":["Filter NaN/Infinity out of computed arrays before assigning them to outputRange.","Wrap risky arithmetic (division, logs) in Number.isFinite checks."],"tags":["interpolate","string-interpolation","numeric","nan-infinity","validation"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}