{"record":{"id":"02e01a8f2cbf7b67","repo":"remotion-dev/remotion","slug":"name-must-be-a-number-number-tuple-02e01a","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/noise-displacement.ts","lineNumber":188,"sourceCode":"\tcenter: [...p.center] as NoiseDisplacementCenter,\n\tradius: p.radius,\n\tstrength: p.strength ?? DEFAULT_STRENGTH,\n\tseed: p.seed ?? DEFAULT_SEED,\n\tgrainSize: p.grainSize ?? DEFAULT_GRAIN_SIZE,\n\tpasses: p.passes ?? DEFAULT_PASSES,\n\tblur: p.blur ?? DEFAULT_BLUR,\n\tfeather: p.feather ?? DEFAULT_FEATHER,\n\tbiasDirection: p.biasDirection ?? DEFAULT_BIAS_DIRECTION,\n\tbiasAmount: p.biasAmount ?? DEFAULT_BIAS_AMOUNT,\n});\n\nconst assertRequiredUvCoordinate = (value: unknown, name: string): void => {\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 assertOptionalIntegerNumber = (value: unknown, name: string): void => {\n\tif (value === undefined) {\n\t\treturn;\n\t}\n\n\tif (!Number.isInteger(value)) {\n\t\tthrow new TypeError(\n\t\t\t`\"${name}\" must be an integer, but got ${JSON.stringify(value)}`,\n\t\t);\n\t}\n};\n\nconst validatePositive = (value: number, name: string): void => {\n\tif (value <= 0) {\n\t\tthrow new TypeError(","sourceCodeStart":170,"sourceCodeEnd":206,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/noise-displacement.ts#L170-L206","documentation":"The noiseDisplacement() effect requires a `center` prop that is a [number, number] tuple representing UV coordinates. assertRequiredUvCoordinate throws this TypeError when `center` is not a two-element array where both elements are finite numbers. This is a required parameter with no default.","triggerScenarios":"Calling noiseDisplacement({ center: [0.5] }) (wrong length), noiseDisplacement({ center: [0.5, '0.5'] }) (string element), noiseDisplacement({ center: {x: 0.5, y: 0.5} }) (object not array), noiseDisplacement({ center: [NaN, 0.5] }), or omitting center entirely.","commonSituations":"Passing an object {x, y} instead of a tuple; deserializing center from JSON where it becomes a different shape; using a 3-element array by mistake; passing Infinity or NaN from upstream math; omitting the required center prop.","solutions":["Provide center as a two-element numeric array: noiseDisplacement({ center: [0.5, 0.5], radius: 0.5 }).","If using an object, convert it: center: [obj.x, obj.y].","Ensure both components are finite numbers — check with Number.isFinite.","Remember center is required (no default) unlike most other noiseDisplacement props."],"exampleFix":"// before\nnoiseDisplacement({ center: {x: 0.5, y: 0.5}, radius: 0.5 })\nnoiseDisplacement({ center: [0.5], radius: 0.5 })\n\n// after\nnoiseDisplacement({ center: [0.5, 0.5], radius: 0.5 })","handlingStrategy":"type-guard","validationCode":"// Validate center before calling noiseDisplacement()\nconst isValidCenter = (c: unknown): c is [number, number] =>\n  Array.isArray(c) &&\n  c.length === 2 &&\n  c.every((item) => typeof item === 'number' && Number.isFinite(item));\n\nif (!isValidCenter(params.center)) {\n  throw new Error('center must be a [number, number] tuple');\n}\nconst result = noiseDisplacement(params);","typeGuard":"const isNoiseDisplacementCenter = (\n  v: unknown,\n): v is readonly [number, number] =>\n  Array.isArray(v) &&\n  v.length === 2 &&\n  typeof v[0] === 'number' &&\n  typeof v[1] === 'number' &&\n  Number.isFinite(v[0]) &&\n  Number.isFinite(v[1]);","tryCatchPattern":null,"preventionTips":["Use the NoiseDisplacementParams TypeScript type — center is required and typed as readonly [number, number].","When converting from {x, y} objects, always produce a tuple: [obj.x, obj.y].","Never omit the required center prop — it has no default unlike most other props."],"tags":["validation","typescript","noise-displacement","params","typeerror"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}