{"record":{"id":"9e24323cb4092e50","repo":"remotion-dev/remotion","slug":"when-easing-is-an-array-it-must-have-one-entry-pe","errorCode":null,"errorMessage":"When easing is an array, it must have one entry per segment between keyframes (length inputRange.length - 1 = ${expectedLength}), but got length ${easing.length}","messagePattern":"When easing is an array, it must have one entry per segment between keyframes \\(length inputRange\\.length - 1 = (.+?)\\), but got length (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/src/interpolate.ts","lineNumber":1052,"sourceCode":"\t\t}\n\t}\n}\n\nexport function assertValidInterpolateEasingOption(\n\teasing: EasingFunction | readonly EasingFunction[] | undefined,\n\tinputRangeLength: number,\n) {\n\tif (easing === undefined) {\n\t\treturn;\n\t}\n\n\tif (typeof easing === 'function') {\n\t\treturn;\n\t}\n\n\tconst expectedLength = inputRangeLength - 1;\n\tif (easing.length !== expectedLength) {\n\t\tthrow new Error(\n\t\t\t`When easing is an array, it must have one entry per segment between keyframes (length inputRange.length - 1 = ${expectedLength}), but got length ${easing.length}`,\n\t\t);\n\t}\n\n\tfor (let i = 0; i < easing.length; i++) {\n\t\tif (typeof easing[i] !== 'function') {\n\t\t\tthrow new Error(`easing[${i}] must be a function`);\n\t\t}\n\t}\n}\n\nexport function assertValidInterpolatePosterizeOption(\n\tposterize: number | undefined,\n) {\n\tif (posterize === undefined) {\n\t\treturn;\n\t}\n","sourceCodeStart":1034,"sourceCodeEnd":1070,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/core/src/interpolate.ts#L1034-L1070","documentation":"Thrown by assertValidInterpolateEasingOption when options.easing is an array whose length does not equal inputRange.length - 1. There is exactly one easing segment between each pair of adjacent keyframes, so N keyframes require N-1 easing functions.","triggerScenarios":"interpolate(t, [0, 1, 2], [0, 50, 100], {easing: [Easing.linear]}); — needs 2 easing entries for 3 keyframes but only 1 supplied. Also when easing array length is copied from outputRange length by mistake.","commonSituations":"Adding/removing a keyframe but forgetting to update the easing array; reusing a single easing function array across ranges of different lengths.","solutions":["Set the easing array length to inputRange.length - 1.","If the same easing applies to every segment, pass a single function (not an array) instead.","Build the easing array programmatically from the keyframe count."],"exampleFix":"// before\nconst r = interpolate(t, [0, 1, 2], [0, 50, 100], {easing: [Easing.linear]});\n// after\nconst r = interpolate(t, [0, 1, 2], [0, 50, 100], {easing: [Easing.linear, Easing.ease]});","handlingStrategy":"validation","validationCode":"const expected = inputRange.length - 1;\nif (Array.isArray(easing) && easing.length !== expected) {\n  throw new Error(`easing array must have length ${expected}`);\n}\nconst r = interpolate(input, inputRange, outputRange, {easing});","typeGuard":"const isEasingArray = (\n  e: unknown,\n  n: number,\n): e is ((t: number) => number)[] =>\n  Array.isArray(e) && e.length === n - 1 && e.every((f) => typeof f === 'function');","tryCatchPattern":null,"preventionTips":["When all segments share one easing, pass a single function instead of an array.","Build the easing array from inputRange.length - 1 programmatically.","Update the easing array whenever you add or remove a keyframe."],"tags":["interpolation","easing","validation"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}