{"record":{"id":"65ab0f2cf72f140c","repo":"remotion-dev/remotion","slug":"name-must-contain-only-numbers","errorCode":null,"errorMessage":"${name} must contain only numbers","messagePattern":"(.+?) must contain only numbers","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/src/interpolate.ts","lineNumber":1027,"sourceCode":"\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,\n) {\n\tif (easing === undefined) {\n\t\treturn;\n\t}\n","sourceCodeStart":1009,"sourceCodeEnd":1045,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/core/src/interpolate.ts#L1009-L1045","documentation":"Thrown by checkInfiniteRange when inputRange or outputRange contains an element whose typeof is not 'number'. Strings, booleans, objects, null, and undefined inside the 1-D numeric ranges are rejected before any interpolation math runs. The name in the message is the offending array ('inputRange' or 'outputRange').","triggerScenarios":"interpolate(0, [0, '1'], [0, 100]); interpolate(0, [0, 1], [0, null]); a range built from JSON-parsed values that arrived as strings; an array containing undefined from a sparse source.","commonSituations":"Parsing config/props as JSON where numbers deserialize as strings; mixing a string unit like '100px' into a numeric outputRange; optional fields rendered as undefined.","solutions":["Coerce every element with Number() and verify none become NaN.","Strip units and quotes from the source data before building the range.","Type the range as number[] and let TypeScript flag non-number assignments."],"exampleFix":"// before\nconst r = interpolate(t, [0, '1'], [0, 100]);\n// after\nconst r = interpolate(t, [0, Number('1')], [0, 100]);","handlingStrategy":"type-guard","validationCode":"const isAllNumbers = (arr: readonly unknown[]): arr is number[] =>\n  arr.every((v) => typeof v === 'number');\n\nif (!isAllNumbers(inputRange) || !isAllNumbers(outputRange)) {\n  throw new Error('ranges must contain only numbers');\n}\nconst r = interpolate(input, inputRange, outputRange);","typeGuard":"const isNumberArray = (arr: readonly unknown[]): arr is number[] =>\n  arr.every((v) => typeof v === 'number');","tryCatchPattern":null,"preventionTips":["Type ranges as number[] so the compiler rejects non-number assignments.","Coerce parsed JSON numbers with Number() and verify they are not NaN.","Strip unit strings before inserting values into numeric ranges."],"tags":["interpolation","validation","type-error"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}