{"record":{"id":"9a4af2a7fdde623f","repo":"remotion-dev/remotion","slug":"cannot-interpolate-output-as-outputtype-because-it-is-a","errorCode":null,"errorMessage":"Cannot interpolate \"${output}\" as ${outputType} because it is a rotate value","messagePattern":"Cannot interpolate \"(.+?)\" as (.+?) because it is a rotate value","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/core/src/interpolate.ts","lineNumber":462,"sourceCode":"\tif (outputType === 'transform-origin') {\n\t\tconst transformOriginParts = output.trim().split(/\\s+/);\n\t\tif (\n\t\t\ttransformOriginParts.length < 1 ||\n\t\t\ttransformOriginParts.length > 3 ||\n\t\t\ttransformOriginParts[0] === ''\n\t\t) {\n\t\t\tthrow new TypeError(\n\t\t\t\t`String outputRange values must contain 1 to 3 components, but got \"${output}\"`,\n\t\t\t);\n\t\t}\n\n\t\treturn parseTransformOriginValue(output, transformOriginParts);\n\t}\n\n\tconst axisRotation = parseAxisRotationValue(output);\n\tif (axisRotation !== null) {\n\t\tif (outputType !== undefined && outputType !== 'rotate') {\n\t\t\tthrow new TypeError(\n\t\t\t\t`Cannot interpolate \"${output}\" as ${outputType} because it is a rotate value`,\n\t\t\t);\n\t\t}\n\n\t\treturn axisRotation;\n\t}\n\n\tconst parts = output.trim().split(/\\s+/);\n\tif (parts.length < 1 || parts.length > 3 || parts[0] === '') {\n\t\tthrow new TypeError(\n\t\t\t`String outputRange values must contain 1 to 3 components, but got \"${output}\"`,\n\t\t);\n\t}\n\n\tif (parts.some((part) => transformOriginKeywords.has(part.toLowerCase()))) {\n\t\tif (outputType !== undefined) {\n\t\t\tthrow new TypeError(\n\t\t\t\t`Cannot interpolate \"${output}\" as ${outputType} because it is a transform-origin value`,","sourceCodeStart":444,"sourceCodeEnd":480,"githubUrl":"https://github.com/remotion-dev/remotion/blob/46a3a6bf13ca367376ff18bbb06dae2e87e0d068/packages/core/src/interpolate.ts#L444-L480","documentation":"interpolate() supports interpolating string transform values. When the output range contains a rotate value (e.g. '45deg') but the declared outputType is something else (or the mix is invalid), a TypeError is thrown because rotate values cannot be interpolated as a different transform kind.","triggerScenarios":"Calling interpolate with string outputs parsed as axis rotations (like '30deg' or 'rotateX(...)') while outputType is set to 'scale', 'translate', etc.","commonSituations":"Passing CSS transform strings with rotation into interpolate and specifying an incorrect outputType; mixing rotate and non-rotate endpoints in the output range.","solutions":["Set outputType: 'rotate' (or omit outputType) when outputs are rotate values.","Remove rotation strings from the output range or convert to numbers.","Split the interpolation so each outputType gets its own interpolate call."],"exampleFix":"// before\ninterpolate(f, [0,1], ['0deg','45deg'], {outputType: 'scale'})\n// after\ninterpolate(f, [0,1], ['0deg','45deg'], {outputType: 'rotate'})","handlingStrategy":"validation","validationCode":"const isRotate = (v: string) => /deg|rad|grad|turn$/.test(v.trim());\nif (outputs.some(isRotate) && outputType !== undefined && outputType !== 'rotate')\n  throw new Error('rotate values require outputType rotate');","typeGuard":null,"tryCatchPattern":"try {\n  interpolate(f, r, vals, {outputType});\n} catch (e) {\n  if (e instanceof TypeError) retryWithoutOutputType();\n}","preventionTips":["Match outputType to the CSS value kinds in the output range.","Don't mix rotate with other transform kinds in one range.","Let outputType be inferred unless necessary."],"tags":["animation","interpolate","validation"],"backgroundTag":"invalid-enum-value","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"}