{"record":{"id":"4ab71495b5627d3d","repo":"remotion-dev/remotion","slug":"outputrange-must-contain-only-numbers-or-supporte","errorCode":null,"errorMessage":"outputRange must contain only numbers, or supported scale, translate, and rotate strings","messagePattern":"outputRange must contain only numbers, or supported scale, translate, and rotate strings","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/core/src/interpolate.ts","lineNumber":1185,"sourceCode":"\n\tif (typeof input !== 'number') {\n\t\tthrow new TypeError('Cannot interpolate an input which is not a number');\n\t}\n\n\tif (!Array.isArray(outputRange)) {\n\t\tthrow new Error('outputRange must contain only numbers');\n\t}\n\n\tconst hasStringOutput = outputRange.some(\n\t\t(output) => typeof output === 'string',\n\t);\n\tif (hasStringOutput) {\n\t\tif (\n\t\t\t!outputRange.every(\n\t\t\t\t(output) => typeof output === 'string' || typeof output === 'number',\n\t\t\t)\n\t\t) {\n\t\t\tthrow new TypeError(\n\t\t\t\t'outputRange must contain only numbers, or supported scale, translate, and rotate strings',\n\t\t\t);\n\t\t}\n\n\t\ttry {\n\t\t\treturn interpolateString({input, inputRange, outputRange, options});\n\t\t} catch (error) {\n\t\t\tif (!outputRange.every((output) => typeof output === 'string')) {\n\t\t\t\tthrow error;\n\t\t\t}\n\n\t\t\tconst hasNonNumericString = outputRange.some((output) => {\n\t\t\t\ttry {\n\t\t\t\t\tparseStringInterpolationValue(output);\n\t\t\t\t\treturn false;\n\t\t\t\t} catch (parseError) {\n\t\t\t\t\treturn parseError instanceof UnsupportedStringInterpolationValueError;\n\t\t\t\t}","sourceCodeStart":1167,"sourceCodeEnd":1203,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/core/src/interpolate.ts#L1167-L1203","documentation":"Thrown by interpolate() in the mixed string-output branch. When at least one output is a string (hasStringOutput), every output must be either a string or a number — the string-interpolation path supports scale/translate/rotate CSS strings mixed with numbers. If any output is neither (a tuple, boolean, object, null), this TypeError fires before interpolateString is attempted.","triggerScenarios":"interpolate(0,[0,1],['100px', true]); interpolate(0,[0,1],['100px', [1,2]]); mixing a CSS string output with a tuple or boolean in the same outputRange.","commonSituations":"Combining transform-string outputs ('rotate(0deg)') with 2D tuple outputs in one array; a stray boolean from a conditional expression slipping into the array.","solutions":["Keep string outputs together only with numbers (no tuples/booleans/objects).","Move tuple-based outputs into a separate interpolate() call.","Audit the array for any element that is not a string or number."],"exampleFix":"// before\nconst r = interpolate(t, [0, 1], ['rotate(0deg)', [0, 1]]);\n// after\nconst rot = interpolate(t, [0, 1], ['rotate(0deg)', 'rotate(90deg)']);","handlingStrategy":"validation","validationCode":"const ok = outputRange.every(\n  (o) => typeof o === 'string' || typeof o === 'number',\n);\nif (outputRange.some((o) => typeof o === 'string') && !ok) {\n  throw new Error('string outputs may mix only with numbers');\n}\nconst r = interpolate(input, inputRange, outputRange);","typeGuard":"const isStringOrNumberArray = (\n  x: unknown[],\n): x is (string | number)[] =>\n  x.every((v) => typeof v === 'string' || typeof v === 'number');","tryCatchPattern":null,"preventionTips":["Keep CSS-string outputs in their own interpolate() call.","Never mix tuples or booleans into a string-output range.","Type string-output ranges as (string | number)[]."],"tags":["interpolation","validation","output-range","css-transform"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}