{"record":{"id":"77d69031cecf258a","repo":"remotion-dev/remotion","slug":"name-must-be-a-number-number-tuple-77d690","errorCode":null,"errorMessage":"\"${name}\" must be a [number, number] tuple","messagePattern":"\"(.+?)\" must be a \\[number, number\\] tuple","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/effects/src/radial-progressive-blur/index.ts","lineNumber":163,"sourceCode":"\twidth: params.width ?? DEFAULT_WIDTH,\n\theight: params.height ?? DEFAULT_HEIGHT,\n\trotation: params.rotation ?? DEFAULT_ROTATION,\n\tstart: params.start ?? DEFAULT_START,\n\tstartBlur: clampBlur(params.startBlur ?? DEFAULT_START_BLUR),\n\tendBlur: clampBlur(params.endBlur ?? DEFAULT_END_BLUR),\n});\n\nconst assertOptionalUvCoordinate = (value: unknown, name: string): void => {\n\tif (value === undefined) {\n\t\treturn;\n\t}\n\n\tif (\n\t\t!Array.isArray(value) ||\n\t\tvalue.length !== 2 ||\n\t\tvalue.some((item) => typeof item !== 'number' || !Number.isFinite(item))\n\t) {\n\t\tthrow new TypeError(`\"${name}\" must be a [number, number] tuple`);\n\t}\n};\n\nconst validateRadialProgressiveBlurParams = (\n\tparams: RadialProgressiveBlurParams,\n): void => {\n\tassertEffectParamsObject(params, 'Radial progressive blur');\n\tassertOptionalUvCoordinate(params.center, 'center');\n\tassertOptionalFiniteNumber(params.width, 'width');\n\tassertOptionalFiniteNumber(params.height, 'height');\n\tassertOptionalFiniteNumber(params.rotation, 'rotation');\n\tvalidateNonNegative(params.width ?? DEFAULT_WIDTH, 'width');\n\tvalidateNonNegative(params.height ?? DEFAULT_HEIGHT, 'height');\n\tassertOptionalFiniteNumber(params.start, 'start');\n\tvalidateUnitInterval(params.start ?? DEFAULT_START, 'start');\n\tassertOptionalFiniteNumber(params.startBlur, 'startBlur');\n\tassertOptionalFiniteNumber(params.endBlur, 'endBlur');\n};","sourceCodeStart":145,"sourceCodeEnd":181,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/radial-progressive-blur/index.ts#L145-L181","documentation":"Thrown by assertOptionalUvCoordinate when radialProgressiveBlur is given a `center` value that is not undefined and not a 2-element array of finite numbers. The center is a UV coordinate pair, so the runtime strictly requires the [number, number] tuple shape before any GL work happens. A TypeError (not Error) is used because this is a caller-contract violation.","triggerScenarios":"Calling `radialProgressiveBlur({center: ...})` with a value that is: an array of length ≠ 2 (e.g. `[0.5]` or `[0.5, 0.5, 0.5]`); an array containing a non-number or non-finite element (e.g. `[0.5, NaN]`, `[0.5, '0.5']`, `[0.5, null]`); or a non-array truthy object (e.g. `{x: 0.5, y: 0.5}`).","commonSituations":"Passing a Vec2/Vector2 object from another library instead of a plain array; animating center with interpolate() but returning 3 or 1 components; copy-pasting a value from an effect that uses [x, y, z]; deserializing JSON where the tuple lost a component; passing `[0.5, undefined]`.","solutions":["Pass exactly two finite numbers: `radialProgressiveBlur({center: [0.5, 0.5]})`.","When animating, build the tuple with an explicit expression: `center: [interpolate(...), interpolate(...)] as [number, number]`.","If you do not need to set center, omit it entirely — it defaults to a valid value.","Convert library vector objects to plain arrays before passing: `[vec.x, vec.y]`.","Validate deserialized input with the type guard below before feeding it to the effect."],"exampleFix":"// before\nimport {radialProgressiveBlur} from '@remotion/effects';\nconst e = radialProgressiveBlur({center: {x: 0.5, y: 0.5}}); // throws TypeError\n// or\nconst e2 = radialProgressiveBlur({center: [0.5]}); // throws TypeError\n\n// after\nconst e = radialProgressiveBlur({center: [0.5, 0.5]});\n// or omit it:\nconst e3 = radialProgressiveBlur({});","handlingStrategy":"type-guard","validationCode":"function asUvCoordinate(v: unknown): [number, number] | undefined {\n  if (v === undefined) return undefined;\n  if (\n    Array.isArray(v) &&\n    v.length === 2 &&\n    v.every((n) => typeof n === 'number' && Number.isFinite(n))\n  ) {\n    return [v[0], v[1]];\n  }\n  throw new TypeError('\"center\" must be a [number, number] tuple');\n}\nconst center = asUvCoordinate(maybeCenter);\nconst effect = radialProgressiveBlur(center === undefined ? {} : {center});","typeGuard":"function isUvCoordinate(v: unknown): v is [number, number] {\n  return (\n    Array.isArray(v) &&\n    v.length === 2 &&\n    v.every((n) => typeof n === 'number' && Number.isFinite(n))\n  );\n}","tryCatchPattern":null,"preventionTips":["Always pass `center` as a plain 2-element number array literal.","When animating, build the tuple explicitly: `[x, y] as [number, number]`.","Convert library vector objects to plain arrays at the boundary.","Use the isUvCoordinate guard on deserialized input before feeding it to the effect.","If you do not need to override center, omit it entirely."],"tags":["validation","radial-progressive-blur","params","typescript","tuple"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}