{"record":{"id":"ff1fe236bdc4e382","repo":"remotion-dev/remotion","slug":"cannot-interpolate-kind-values-with-parsed-ki","errorCode":null,"errorMessage":"Cannot interpolate ${kind} values with ${parsed.kind} values","messagePattern":"Cannot interpolate (.+?) values with (.+?) values","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/core/src/interpolate.ts","lineNumber":805,"sourceCode":"\t\t\t\t\tunits: [null, null, null, parsed.units[0]] as [\n\t\t\t\t\t\tnull,\n\t\t\t\t\t\tnull,\n\t\t\t\t\t\tnull,\n\t\t\t\t\t\tstring | null,\n\t\t\t\t\t],\n\t\t\t\t\tdimensions: 4,\n\t\t\t\t\taxisRotation: true,\n\t\t\t\t};\n\t\t\t})\n\t\t: initiallyParsedOutputRange;\n\tconst kind = parsedOutputRange[0]?.kind;\n\tif (kind === undefined) {\n\t\tthrow new Error('outputRange must have at least 1 element');\n\t}\n\n\tfor (const parsed of parsedOutputRange) {\n\t\tif (parsed.kind !== kind) {\n\t\t\tthrow new TypeError(\n\t\t\t\t`Cannot interpolate ${kind} values with ${parsed.kind} values`,\n\t\t\t);\n\t\t}\n\t}\n\n\tconst dimensions = Math.max(\n\t\t...parsedOutputRange.map((parsed) => parsed.dimensions),\n\t);\n\tconst units: [string | null, string | null, string | null, string | null] = [\n\t\tnull,\n\t\tnull,\n\t\tnull,\n\t\tnull,\n\t];\n\n\tif (kind !== 'scale') {\n\t\tfor (let axis = 0; axis < dimensions; axis++) {\n\t\t\tif (hasAxisRotation && axis < 3) {","sourceCodeStart":787,"sourceCodeEnd":823,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/core/src/interpolate.ts#L787-L823","documentation":"Thrown by interpolateString after parsing every outputRange element when the kinds disagree across elements (e.g. one element is a translate and another is a scale, or one is a rotate and another a translate). All elements must share one kind so the same axis set and interpolation math applies across the whole range.","triggerScenarios":"interpolate(input, inputRange, outputRange) with mismatched element kinds: [\"0px\", \"1\"] (translate vs scale), [\"90deg\", \"0px\"] (rotate vs translate), [\"1\", \"2px 3px\"] (scale vs translate).","commonSituations":"Conditionally building outputRange from different units at runtime; refactoring a numeric outputRange to strings and forgetting to align kinds; mixing a unitless scale number with a translate length.","solutions":["Align every element to the same kind: all translate (\"0px\", \"10px\"), all scale (\"1\", \"2\"), or all rotate (\"0deg\", \"90deg\").","Use separate interpolate() calls per transform type and compose the resulting transform string."],"exampleFix":"// before\ninterpolate(t, [0, 1], [\"0px\", \"1\"]);\n// after\ninterpolate(t, [0, 1], [\"0px\", \"10px\"]);","handlingStrategy":"validation","validationCode":"function elementKind(value: string | number): 'scale' | 'translate' | 'rotate' | 'transform-origin' {\n  if (typeof value === 'number') return 'scale';\n  const parts = value.trim().split(/\\s+/);\n  if (parts.some((p) => /^(left|right|top|bottom|center)$/i.test(p))) return 'transform-origin';\n  const kinds = parts.map((p) => {\n    const m = /^([+-]?(?:\\d+\\.?\\d*|\\.\\d+))([a-zA-Z%]+)?$/.exec(p);\n    if (!m) return 'unknown';\n    if (!m[2]) return 'scale';\n    if (['deg','rad','grad','turn'].includes(m[2])) return 'rotate';\n    return 'translate';\n  });\n  return kinds[0] as any;\n}\n\nconst kinds = outputRange.map(elementKind);\nif (!kinds.every((k) => k === kinds[0])) {\n  throw new Error(`Mismatched outputRange kinds: ${kinds.join(', ')}`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep every element of outputRange the same kind (all scale, all translate, all rotate, or all transform-origin).","Avoid conditionally swapping a unit-less number for a length in the same array."],"tags":["interpolate","string-interpolation","kind-mismatch","validation"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}