{"record":{"id":"8c807c1d0f37fc94","repo":"remotion-dev/remotion","slug":"origin-must-be-a-number-number-tuple","errorCode":null,"errorMessage":"\"origin\" must be a [number, number] tuple","messagePattern":"\"origin\" must be a \\[number, number\\] tuple","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/effects/src/starburst.ts","lineNumber":142,"sourceCode":"\t\tthrow new TypeError(\n\t\t\t`\"smoothness\" must be a finite number, but got ${JSON.stringify(params.smoothness)}`,\n\t\t);\n\t}\n\n\tif (r.smoothness < 0 || r.smoothness > 1) {\n\t\tthrow new RangeError(\n\t\t\t`\"smoothness\" must be between 0 and 1, but got ${r.smoothness}`,\n\t\t);\n\t}\n\n\tif (\n\t\t!Array.isArray(r.origin) ||\n\t\tr.origin.length !== 2 ||\n\t\tr.origin.some((coordinate) => {\n\t\t\treturn typeof coordinate !== 'number' || !Number.isFinite(coordinate);\n\t\t})\n\t) {\n\t\tthrow new TypeError('\"origin\" must be a [number, number] tuple');\n\t}\n\n\tif (r.origin.some((coordinate) => coordinate < 0 || coordinate > 1)) {\n\t\tthrow new RangeError(\n\t\t\t`\"origin\" must contain coordinates between 0 and 1, but got ${JSON.stringify(r.origin)}`,\n\t\t);\n\t}\n\n\tfor (const c of r.colors) {\n\t\tcolorToRgb(c);\n\t}\n};\n\nconst STARBURST_VS = /* glsl */ `#version 300 es\nin vec2 aPos;\nin vec2 aUv;\nout vec2 vUv;\nvoid main() {","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/starburst.ts#L124-L160","documentation":"The starburst effect's optional `origin` parameter must be a `[number, number]` tuple. This TypeError is thrown by `validateStarburstEffectParams` when `origin` is present but is not a 2-element array, or when either element is not a finite number (NaN, Infinity, string, etc.). It runs during the effect's `validateParams` phase before any GPU work begins, so it surfaces as a configuration error at render time.","triggerScenarios":"Passing `origin` as a non-array (e.g. `origin: 'center'`), an array with wrong length (e.g. `origin: [0.5]` or `origin: [0.5, 0.5, 0.5]`), or an array containing non-numbers/non-finite values (e.g. `origin: [0.5, NaN]`, `origin: ['0.5', '0.5']`, `origin: [Infinity, 0.5]`).","commonSituations":"Typo or copy-paste from another API that accepts string origins; deserializing origin from JSON where numbers became strings; computing origin dynamically and accidentally producing NaN via a division by zero or undefined input; TypeScript types bypassed via `as any`.","solutions":["Set `origin` to a tuple of two finite numbers between 0 and 1, e.g. `origin: [0.5, 0.5]`.","Omit `origin` entirely to use the default `[0.5, 0.5]`.","If computing origin dynamically, guard each component with `Number.isFinite()` before passing it in."],"exampleFix":"// before\nstarburst({rays: 6, colors: ['#f00', '#00f'], origin: [0.5, NaN]});\n// after\nstarburst({rays: 6, colors: ['#f00', '#00f'], origin: [0.5, 0.5]});","handlingStrategy":"validation","validationCode":"const isOriginTuple = (v: unknown): v is readonly [number, number] =>\n  Array.isArray(v) &&\n  v.length === 2 &&\n  v.every((c) => typeof c === 'number' && Number.isFinite(c));\n\nconst params = {rays: 6, colors: ['#f00', '#00f'], origin: computeOrigin()};\nif (params.origin !== undefined && !isOriginTuple(params.origin)) {\n  throw new Error('Invalid starburst origin');\n}","typeGuard":"const isStarburstOrigin = (v: unknown): v is readonly [number, number] =>\n  Array.isArray(v) &&\n  v.length === 2 &&\n  v.every((c) => typeof c === 'number' && Number.isFinite(c));","tryCatchPattern":"try {\n  starburst({...params});\n} catch (e) {\n  if (e instanceof TypeError && /origin.*tuple/.test(e.message)) {\n    // fall back to default origin\n    starburst({...params, origin: [0.5, 0.5]});\n  } else throw e;\n}","preventionTips":["Always type `origin` as `readonly [number, number]` and let TypeScript enforce the tuple shape.","Validate dynamically-computed origins with `Number.isFinite` on both components before passing.","Omit `origin` when you want the default center rather than passing an explicit value."],"tags":["starburst","validation","params","origin","tuple"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}