{"record":{"id":"12b18a1579b214f3","repo":"remotion-dev/remotion","slug":"outputtype-outputrange-must-contain-strings-with-the","errorCode":null,"errorMessage":"${outputType} outputRange must contain strings with the appropriate CSS units","messagePattern":"(.+?) outputRange must contain strings with the appropriate CSS units","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/core/src/interpolate.ts","lineNumber":1346,"sourceCode":"\t\t) {\n\t\t\tthrow new TypeError(\n\t\t\t\t'Font weight outputRange must contain only numbers or strings',\n\t\t\t);\n\t\t}\n\n\t\treturn interpolateFontWeight({\n\t\t\tinput,\n\t\t\tinputRange,\n\t\t\toutputRange,\n\t\t\toptions,\n\t\t});\n\t}\n\n\tconst hasStringOutput = outputRange.some(\n\t\t(output) => typeof output === 'string',\n\t);\n\tif (outputType !== undefined && outputType !== 'scale' && !hasStringOutput) {\n\t\tthrow new TypeError(\n\t\t\t`${outputType} outputRange must contain strings with the appropriate CSS units`,\n\t\t);\n\t}\n\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({\n\t\t\t\tinput,","sourceCodeStart":1328,"sourceCodeEnd":1364,"githubUrl":"https://github.com/remotion-dev/remotion/blob/46a3a6bf13ca367376ff18bbb06dae2e87e0d068/packages/core/src/interpolate.ts#L1328-L1364","documentation":"For outputType 'translate', 'rotate', or 'transform-origin' (anything except 'scale'), the outputRange must contain strings carrying CSS units (e.g. '100px', '45deg'). Remotion throws a TypeError when the outputRange has no string entries at all, since unitless numbers cannot express these CSS transforms.","triggerScenarios":"Calling `interpolateColors(..., {outputType: 'translate'|'rotate'|'transform-origin'})` with a purely numeric outputRange like [0, 100] instead of ['0px', '100px'].","commonSituations":"Passing plain numbers because scale-like usage worked before, switching outputType from 'scale' to 'translate' without updating the range, or forgetting units such as px/deg/% in the range strings.","solutions":["Add CSS units to every string in the outputRange, e.g. ['0px','100px'] for translate or ['0deg','90deg'] for rotate.","Ensure outputRange contains at least one string when outputType is not 'scale'.","If unitless numbers are intended, use outputType: 'scale' instead.","Use template strings to attach units: `${value}px`."],"exampleFix":"// before\ninterpolateColors(progress, [0, 1], [0, 100], {outputType: 'translate'});\n// after\ninterpolateColors(progress, [0, 1], ['0px', '100px'], {outputType: 'translate'});","handlingStrategy":"validation","validationCode":"if (outputType && outputType !== 'scale' &&\n    !outputRange.some((o) => typeof o === 'string')) {\n  throw new TypeError(`${outputType} outputRange needs strings with CSS units, e.g. '100px' or '45deg'`);\n}","typeGuard":"const hasUnitStrings = (r: unknown[]): r is string[] =>\n  r.some((o) => typeof o === 'string' && /^[\\d.-]+(px|deg|%|em|rem|vh|vw)$/.test(o));","tryCatchPattern":"try {\n  return interpolateColors(input, inputRange, outputRange, {outputType});\n} catch (e) {\n  if (e instanceof TypeError && e.message.includes('must contain strings with the appropriate CSS units')) {\n    console.error(`outputRange ${JSON.stringify(outputRange)} lacks CSS units for ${outputType}`);\n  }\n  throw e;\n}","preventionTips":["Attach units to transform values: px for translate, deg for rotate.","Remember only 'scale' accepts (effectively) unitless numeric ranges.","Build ranges with template strings (`${v}px`) so units are never forgotten.","Double-check ranges when changing outputType between 'scale' and other types."],"tags":["validation","css","interpolation"],"backgroundTag":"invalid-argument-format","analyzedSha":"46a3a6bf13ca367376ff18bbb06dae2e87e0d068","analyzedAt":"2026-09-18T00:12:20.256Z","contentChangedAt":"2026-09-18T00:12:20.256Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}