{"record":{"id":"f3c1d90fd2bca60c","repo":"remotion-dev/remotion","slug":"input-can-not-be-undefined-f3c1d9","errorCode":null,"errorMessage":"input can not be undefined","messagePattern":"input can not be undefined","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/src/interpolate.ts","lineNumber":1140,"sourceCode":"\tinput: number,\n\tinputRange: readonly number[],\n\toutputRange: readonly (readonly number[])[],\n\toptions?: InterpolateOptions,\n): number[];\nexport function interpolate(\n\tinput: number,\n\tinputRange: readonly number[],\n\toutputRange: readonly (number | string | readonly number[])[],\n\toptions?: InterpolateOptions,\n): number | string | readonly number[];\nexport function interpolate(\n\tinput: number,\n\tinputRange: readonly number[],\n\toutputRange: readonly InterpolateOutputValue[],\n\toptions?: InterpolateOptions,\n): number | string | readonly number[] {\n\tif (typeof input === 'undefined') {\n\t\tthrow new Error('input can not be undefined');\n\t}\n\n\tif (typeof inputRange === 'undefined') {\n\t\tthrow new Error('inputRange can not be undefined');\n\t}\n\n\tif (typeof outputRange === 'undefined') {\n\t\tthrow new Error('outputRange can not be undefined');\n\t}\n\n\tif (inputRange.length !== outputRange.length) {\n\t\tthrow new Error(\n\t\t\t'inputRange (' +\n\t\t\t\tinputRange.length +\n\t\t\t\t') and outputRange (' +\n\t\t\t\toutputRange.length +\n\t\t\t\t') must have the same length',\n\t\t);","sourceCodeStart":1122,"sourceCodeEnd":1158,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/core/src/interpolate.ts#L1122-L1158","documentation":"Thrown at the top of the interpolate() implementation when the input argument is undefined. This is a dedicated guard before any range validation, because typeof undefined !== 'number' but the author wants a clearer message than the generic non-number error.","triggerScenarios":"interpolate(undefined, [0,1], [0,100]); passing a variable that was never assigned; reading a missing field from an object, e.g. interpolate(obj.missing, [...], [...]).","commonSituations":"Destructuring a prop that does not exist; calling interpolate inside a component before the value prop has loaded; a defaulted parameter that resolved to undefined.","solutions":["Ensure the input argument is a defined number before calling interpolate().","Provide a sensible default value for the source variable.","Skip the interpolation call when the input is not yet available."],"exampleFix":"// before\nconst r = interpolate(progress, [0, 1], [0, 100]); // progress is undefined\n// after\nconst r = interpolate(progress ?? 0, [0, 1], [0, 100]);","handlingStrategy":"validation","validationCode":"if (input === undefined) {\n  throw new Error('input is required');\n}\nconst r = interpolate(input, inputRange, outputRange);","typeGuard":"const isDefinedNumber = (v: unknown): v is number =>\n  typeof v === 'number';","tryCatchPattern":null,"preventionTips":["Default the input variable with ?? 0 when it may be undefined.","Type the input strictly as number in the function signature.","Skip the interpolation call until the input value has loaded."],"tags":["interpolation","validation","input"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}