{"record":{"id":"5a6214c09216f801","repo":"remotion-dev/remotion","slug":"name-must-have-at-least-1-element","errorCode":null,"errorMessage":"${name} must have at least 1 element","messagePattern":"(.+?) must have at least 1 element","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/src/interpolate.ts","lineNumber":1022,"sourceCode":"\t\t}),\n\t);\n};\n\nfunction checkValidInputRange(arr: readonly number[]) {\n\tfor (let i = 1; i < arr.length; ++i) {\n\t\tif (!(arr[i] > arr[i - 1])) {\n\t\t\tthrow new Error(\n\t\t\t\t`inputRange must be strictly monotonically increasing but got [${arr.join(\n\t\t\t\t\t',',\n\t\t\t\t)}]`,\n\t\t\t);\n\t\t}\n\t}\n}\n\nfunction checkInfiniteRange(name: string, arr: readonly number[]) {\n\tif (arr.length < 1) {\n\t\tthrow new Error(name + ' must have at least 1 element');\n\t}\n\n\tfor (const element of arr) {\n\t\tif (typeof element !== 'number') {\n\t\t\tthrow new Error(`${name} must contain only numbers`);\n\t\t}\n\n\t\tif (!Number.isFinite(element)) {\n\t\t\tthrow new Error(\n\t\t\t\t`${name} must contain only finite numbers, but got [${arr.join(',')}]`,\n\t\t\t);\n\t\t}\n\t}\n}\n\nexport function assertValidInterpolateEasingOption(\n\teasing: EasingFunction | readonly EasingFunction[] | undefined,\n\tinputRangeLength: number,","sourceCodeStart":1004,"sourceCodeEnd":1040,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/core/src/interpolate.ts#L1004-L1040","documentation":"Thrown by checkInfiniteRange when the named array (inputRange or outputRange) has fewer than 1 element. Interpolation needs at least one keyframe to produce a value, so an empty range is unrecoverable. The message substitutes the array name ('inputRange' or 'outputRange').","triggerScenarios":"Calling interpolate() with inputRange = [] or outputRange = []; passing an array that was filtered down to nothing, e.g. keyframes.filter(k => k.active) when none are active.","commonSituations":"Dynamically building ranges from data that can be empty; conditional keyframe arrays that resolve to [] under some config; reading a range prop that was never populated.","solutions":["Provide at least one element to both inputRange and outputRange.","Guard the call site so interpolate() is skipped when the range array is empty.","Default the array to a sensible single keyframe instead of []."],"exampleFix":"// before\nconst r = interpolate(t, [], []);\n// after\nconst r = interpolate(t, [0, 1], [0, 100]);","handlingStrategy":"validation","validationCode":"if (inputRange.length === 0 || outputRange.length === 0) {\n  return; // nothing to interpolate\n}\nconst r = interpolate(input, inputRange, outputRange);","typeGuard":"const isNonEmpty = (arr: readonly unknown[]): boolean => arr.length > 0;","tryCatchPattern":null,"preventionTips":["Default range arrays to a valid single keyframe rather than [].","Skip the interpolate() call when source data is empty.","Log a warning when a dynamically built range comes back empty."],"tags":["interpolation","validation","input-range","output-range"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}