{"record":{"id":"b17ad265d86a7f03","repo":"remotion-dev/remotion","slug":"name-must-be-a-number-number-tuple-b17ad2","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/pattern.ts","lineNumber":231,"sourceCode":"\trowOffset: p.rowOffset ?? DEFAULT_OFFSET,\n\trowOffsetEvery: p.rowOffsetEvery ?? DEFAULT_OFFSET_EVERY,\n\tcolumnOffset: p.columnOffset ?? DEFAULT_OFFSET,\n\tcolumnOffsetEvery: p.columnOffsetEvery ?? DEFAULT_OFFSET_EVERY,\n\torigin: [...(p.origin ?? DEFAULT_ORIGIN)] as PatternOrigin,\n\twrap: p.wrap ?? DEFAULT_WRAP,\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 assertOptionalInteger = (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(`\"${name}\" must be > 0`);","sourceCodeStart":213,"sourceCodeEnd":249,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/pattern.ts#L213-L249","documentation":"pattern() validates its optional 'origin' prop (a UV coordinate) and requires it, when supplied, to be an array of exactly two finite numbers. This TypeError fires before any GPU work when the value is present but malformed (wrong length, non-array, or non-finite entries like NaN/Infinity).","triggerScenarios":"Calling pattern({ origin: <value> }) where <value> is defined but not a 2-tuple of finite numbers, e.g. origin: [0.5], origin: 'center', origin: [0, NaN], origin: {x:0,y:0}. The check assertOptionalUvCoordinate runs in validatePatternParams during effect setup.","commonSituations":"Passing origin as a string or object from a config/UI; reading origin from JSON that truncated the array; animated values producing NaN via division by zero; passing a 3-element vector by mistake.","solutions":["Pass origin as a readonly [number, number] tuple of finite values, e.g. [0.5, 0.5].","Omit origin entirely to accept the default [0, 0].","Coerce inputs from your data layer into the tuple shape before calling pattern().","If animating, guard the computed components with Number.isFinite before forwarding."],"exampleFix":"// before\npattern({ origin: 'center' })\npattern({ origin: [0.5] })\n\n// after\npattern({ origin: [0.5, 0.5] })\n// or omit it:\npattern({ scale: 0.2 })","handlingStrategy":"type-guard","validationCode":"// Validate origin before calling pattern().\nfunction isValidOrigin(v: unknown): v is readonly [number, number] {\n  return Array.isArray(v) && v.length === 2 && v.every((n) => typeof n === 'number' && Number.isFinite(n));\n}\nif (originInput !== undefined && !isValidOrigin(originInput)) {\n  throw new Error('origin must be a [number, number] tuple of finite values');\n}\npattern({ origin: originInput });","typeGuard":"const isUvTuple = (v: unknown): v is readonly [number, number] =>\n  Array.isArray(v) &&\n  v.length === 2 &&\n  v.every((item) => typeof item === 'number' && Number.isFinite(item));","tryCatchPattern":null,"preventionTips":["Type origin as PatternOrigin (readonly [number, number]) in your own prop types.","Sanitize data from JSON/config into tuples before forwarding to pattern().","When animating origin components, guard each with Number.isFinite.","Omit origin to accept the [0, 0] default rather than passing null/undefined inside the tuple."],"tags":["validation","typescript","pattern-effect","uv-coordinate","params"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}