{"record":{"id":"2ed99ab5613606d6","repo":"remotion-dev/remotion","slug":"cannot-interpolate-output-as-outputtype-because-it-is-a-2ed99a","errorCode":null,"errorMessage":"Cannot interpolate \"${output}\" as ${outputType} because it is a transform-origin value","messagePattern":"Cannot interpolate \"(.+?)\" as (.+?) because it is a transform-origin value","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/core/src/interpolate.ts","lineNumber":500,"sourceCode":"\t\t}\n\n\t\treturn parseTransformOriginValue(output, parts);\n\t}\n\n\tconst parsed = parts.map((part) =>\n\t\tparseStringInterpolationComponent(part, output),\n\t);\n\tconst [{kind}] = parsed;\n\tfor (const part of parsed) {\n\t\tif (part.kind !== kind) {\n\t\t\tthrow new TypeError(\n\t\t\t\t`Cannot interpolate \"${output}\" because it mixes ${kind} and ${part.kind} values`,\n\t\t\t);\n\t\t}\n\t}\n\n\tif (outputType !== undefined && outputType !== kind) {\n\t\tthrow new TypeError(\n\t\t\t`Cannot interpolate \"${output}\" as ${outputType} because it is a ${kind} value`,\n\t\t);\n\t}\n\n\tif (kind === 'scale') {\n\t\tconst x = parsed[0].value;\n\t\tconst y = parsed[1]?.value ?? x;\n\t\tconst z = parsed[2]?.value ?? 1;\n\t\treturn {\n\t\t\tkind,\n\t\t\tvalues: [x, y, z, 0],\n\t\t\tunits: [null, null, null, null],\n\t\t\tdimensions: parsed.length,\n\t\t\taxisRotation: false,\n\t\t};\n\t}\n\n\treturn {","sourceCodeStart":482,"sourceCodeEnd":518,"githubUrl":"https://github.com/remotion-dev/remotion/blob/46a3a6bf13ca367376ff18bbb06dae2e87e0d068/packages/core/src/interpolate.ts#L482-L518","documentation":"interpolate() infers the transform kind (scale, translate, rotate, etc.) of string output values; all outputs must be the same kind and match the declared outputType. When the inferred kind differs from outputType, a TypeError is thrown because values of different transform kinds cannot be interpolated together.","triggerScenarios":"interpolate called with string outputs like '10px' (translate) or '1.5' (scale) plus an outputType that doesn't match the inferred kind; mixing kinds across the output range triggers a sibling error and mismatched outputType triggers this one.","commonSituations":"Passing 'translate' values with outputType: 'scale'; refactoring animations and leaving a stale outputType; mixing '10px' and '50%' values in one range.","solutions":["Correct outputType to match the actual output values (e.g. 'translate' for px values).","Make all output range values the same transform kind.","Remove outputType and let interpolation infer, or split into separate interpolations."],"exampleFix":"// before\ninterpolate(f, [0,1], ['0px','100px'], {outputType: 'scale'})\n// after\ninterpolate(f, [0,1], ['0px','100px'], {outputType: 'translate'})","handlingStrategy":"validation","validationCode":"const kinds = outputs.map(inferKind); // e.g. px->translate, unitless->scale\nif (new Set(kinds).size > 1) throw new Error('mixed transform kinds');","typeGuard":null,"tryCatchPattern":"try {\n  interpolate(f, r, vals, {outputType});\n} catch (e) {\n  if (e instanceof TypeError) normalizeOutputRange();\n}","preventionTips":["Keep all output values the same kind (all px, all unitless, etc.).","Update outputType when changing animation values.","Validate ranges with a helper before calling interpolate."],"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"}