{"record":{"id":"d279c3f716558f29","repo":"remotion-dev/remotion","slug":"starburst-effect-requires-a-parameters-object-but","errorCode":null,"errorMessage":"Starburst effect requires a parameters object, but got ${JSON.stringify(params)}","messagePattern":"Starburst effect requires a parameters object, but got (.+?)","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/effects/src/starburst.ts","lineNumber":92,"sourceCode":"type StarburstResolved = {\n\trays: number;\n\tcolors: readonly string[];\n\trotation: number;\n\tsmoothness: number;\n\torigin: StarburstOrigin;\n};\n\nconst resolve = (p: StarburstEffectParams): StarburstResolved => ({\n\trays: p.rays,\n\tcolors: p.colors,\n\trotation: p.rotation ?? 0,\n\tsmoothness: p.smoothness ?? 0,\n\torigin: (p.origin ?? DEFAULT_ORIGIN) as StarburstOrigin,\n});\n\nconst validateStarburstEffectParams = (params: StarburstEffectParams): void => {\n\tif (params === null || typeof params !== 'object') {\n\t\tthrow new TypeError(\n\t\t\t`Starburst effect requires a parameters object, but got ${JSON.stringify(params)}`,\n\t\t);\n\t}\n\n\tconst {rays, colors} = params;\n\n\tif (typeof rays !== 'number' || !Number.isFinite(rays)) {\n\t\tthrow new TypeError(\n\t\t\t`\"rays\" must be a finite number, but got ${JSON.stringify(rays)}`,\n\t\t);\n\t}\n\n\tif (rays < 2 || rays > 100) {\n\t\tthrow new RangeError(`\"rays\" must be between 2 and 100, but got ${rays}`);\n\t}\n\n\tif (!Array.isArray(colors) || colors.length < 2) {\n\t\tthrow new TypeError(","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/starburst.ts#L74-L110","documentation":"validateStarburstEffectParams() in packages/effects/src/starburst.ts throws this TypeError when the params passed to starburst() are not an object — i.e. null, undefined, or a primitive. starburst() requires a parameters object with at least `rays` and `colors`, so rejecting non-objects up front prevents a confusing downstream crash inside resolve() or the WebGL setup.","triggerScenarios":"Calling starburst(null), starburst(undefined), or starburst('starburst') — typically from untyped JavaScript, deserialized JSON, or a refactor that removed the argument. In TypeScript this is suppressed at compile time by the StarburstEffectParams type, so it surfaces mainly in JS callers or escaped `any` values.","commonSituations":"Passing a value loaded from JSON/config without validation; a partial refactor that left starburst() with no argument; spreading a possibly-null variable; calling the effect from dynamically-built effect arrays.","solutions":["Pass a parameters object literal with the required `rays` and `colors` fields: starburst({ rays: 12, colors: ['#ff0000','#00ff00'] }).","If the value comes from JSON or an untyped source, narrow it with a type guard before calling starburst().","Audit the call site for accidental undefined/null (e.g. a destructuring that produced undefined).","Add a TypeScript type annotation on the variable so the compiler rejects non-object inputs at build time."],"exampleFix":"// before\nconst params = JSON.parse(configText);\nstarburst(params); // params may be null/primitive\n\n// after\nconst params = JSON.parse(configText);\nif (typeof params !== 'object' || params === null) {\n  throw new Error('starburst config must be an object');\n}\nstarburst({ rays: params.rays, colors: params.colors });","handlingStrategy":"type-guard","validationCode":"function isStarburstParamsObject(v: unknown): v is Record<string, unknown> {\n  return typeof v === 'object' && v !== null;\n}\n\nconst raw: unknown = JSON.parse(configText);\nif (!isStarburstParamsObject(raw)) {\n  throw new Error('starburst() requires a parameters object');\n}\nstarburst({ rays: raw.rays, colors: raw.colors });","typeGuard":"function isStarburstParams(v: unknown): v is { rays: unknown; colors: unknown } {\n  return typeof v === 'object' && v !== null && 'rays' in v && 'colors' in v;\n}","tryCatchPattern":"try {\n  starburst(maybeParams as StarburstEffectParams);\n} catch (err) {\n  if (err instanceof TypeError && /Starburst effect requires a parameters object/.test(err.message)) {\n    console.error('starburst() was called without a params object:', maybeParams);\n    // fix the source of the value, then retry\n    throw err;\n  }\n  throw err;\n}","preventionTips":["Always call starburst() with an object literal: starburst({ rays, colors }).","Type untrusted inputs (JSON, config) before passing them to starburst().","Let TypeScript's StarburstEffectParams type flag missing arguments at build time.","Validate at the trust boundary when deserializing effect parameters."],"tags":["validation","effects","starburst","typescript","parameters"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}