{"record":{"id":"c97a3348555864d4","repo":"remotion-dev/remotion","slug":"name-must-be-greater-than-0-but-got-json-s","errorCode":null,"errorMessage":"\"${name}\" must be greater than 0, but got ${JSON.stringify(value)}","messagePattern":"\"(.+?)\" must be greater than 0, but got (.+?)","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/effects/src/burlap.ts","lineNumber":113,"sourceCode":"\treadonly uRoughness: WebGLUniformLocation | null;\n\treadonly uSeed: WebGLUniformLocation | null;\n\treadonly uColor: WebGLUniformLocation | null;\n\treadonly colorCtx: CanvasRenderingContext2D;\n\tcachedColor: string;\n\tcachedColorRgba: ParsedColorRgba;\n};\n\nconst resolve = (p: BurlapParams): BurlapResolved => ({\n\tamount: p.amount ?? DEFAULT_AMOUNT,\n\tsize: p.size ?? DEFAULT_SIZE,\n\troughness: p.roughness ?? DEFAULT_ROUGHNESS,\n\tseed: p.seed ?? DEFAULT_SEED,\n\tcolor: p.color ?? DEFAULT_COLOR,\n});\n\nconst validatePositive = (value: number, name: string): void => {\n\tif (value <= 0) {\n\t\tthrow new TypeError(\n\t\t\t`\"${name}\" must be greater than 0, but got ${JSON.stringify(value)}`,\n\t\t);\n\t}\n};\n\nconst validateBurlapParams = (params: BurlapParams): void => {\n\tassertEffectParamsObject(params, 'Burlap');\n\tassertOptionalFiniteNumber(params.amount, 'amount');\n\tassertOptionalFiniteNumber(params.size, 'size');\n\tassertOptionalFiniteNumber(params.roughness, 'roughness');\n\tassertOptionalFiniteNumber(params.seed, 'seed');\n\tassertOptionalColor(params.color, 'color');\n\n\tconst r = resolve(params);\n\tvalidateUnitInterval(r.amount, 'amount');\n\tvalidatePositive(r.size, 'size');\n\tvalidateUnitInterval(r.roughness, 'roughness');\n};","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/burlap.ts#L95-L131","documentation":"Thrown by `validatePositive` (a TypeError) during `validateBurlapParams` when the resolved `size` value is <= 0. Burlap's `size` param controls weave-strand spacing in pixels and must be strictly positive; the default is 5. This is the only error in the set that is a direct user-input validation failure, raised before any GL work.","triggerScenarios":"Fires at line 112-116 when `validatePositive(r.size, 'size')` is called with a resolved size <= 0 (explicitly passed 0, a negative number, or -0). The amount/roughness unit-interval checks run before it.","commonSituations":"Passing `{size: 0}` or a negative size to the `burlap()` effect; computing size dynamically from a value that can hit zero (e.g. scaling by a fade that bottoms out); confusing size with amount (which allows 0).","solutions":["Pass a strictly positive `size` (e.g. the default 5, or any value in the documented 0.1–80 range).","Clamp the dynamic value before passing: `size: Math.max(0.1, computedSize)`.","Re-check that you are setting `size`, not `amount`; `amount` may be 0 but `size` may not."],"exampleFix":"// before\nburlap({size: 0});\n\n// after\nburlap({size: Math.max(0.1, computedSize)});","handlingStrategy":"validation","validationCode":"function validBurlapSize(size: number | undefined): boolean {\n  const s = size ?? 5; // default\n  return Number.isFinite(s) && s > 0;\n}\n// before calling burlap:\nif (!validBurlapSize(params.size)) { params = {...params, size: 5}; }","typeGuard":"function isPositiveSize(v: unknown): v is number {\n  return typeof v === 'number' && Number.isFinite(v) && v > 0;\n}","tryCatchPattern":null,"preventionTips":["Validate `size` is strictly positive before passing to burlap().","Clamp dynamically-computed sizes: `Math.max(0.1, value)`.","Remember `amount` may be 0 but `size` may not."],"tags":["validation","burlap","params","typeerror","user-input"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}