{"record":{"id":"ed826e29b61b6c53","repo":"remotion-dev/remotion","slug":"size-must-be-greater-than-0-but-got-json-stri","errorCode":null,"errorMessage":"\"size\" must be greater than 0, but got ${JSON.stringify(resolved.size)}","messagePattern":"\"size\" must be greater than 0, but got (.+?)","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/effects/src/flannel.ts","lineNumber":117,"sourceCode":"\tsize: params.size ?? DEFAULT_SIZE,\n\tsoftness: params.softness ?? DEFAULT_SOFTNESS,\n\tbaseColor: params.baseColor ?? DEFAULT_BASE_COLOR,\n\tstripeColor: params.stripeColor ?? DEFAULT_STRIPE_COLOR,\n});\n\nconst validateFlannelParams = (params: FlannelParams): void => {\n\tassertEffectParamsObject(params, 'Flannel');\n\tassertOptionalFiniteNumber(params.amount, 'amount');\n\tassertOptionalFiniteNumber(params.size, 'size');\n\tassertOptionalFiniteNumber(params.softness, 'softness');\n\tassertOptionalColor(params.baseColor, 'baseColor');\n\tassertOptionalColor(params.stripeColor, 'stripeColor');\n\n\tconst resolved = resolve(params);\n\tvalidateUnitInterval(resolved.amount, 'amount');\n\tvalidateUnitInterval(resolved.softness, 'softness');\n\tif (resolved.size <= 0) {\n\t\tthrow new TypeError(\n\t\t\t`\"size\" must be greater than 0, but got ${JSON.stringify(resolved.size)}`,\n\t\t);\n\t}\n};\n\nconst FLANNEL_VS = /* glsl */ `#version 300 es\nin vec2 aPos;\nin vec2 aUv;\nout vec2 vUv;\n\nvoid main() {\n\tvUv = aUv;\n\tgl_Position = vec4(aPos, 0.0, 1.0);\n}\n`;\n\nconst FLANNEL_FS = /* glsl */ `#version 300 es\nprecision highp float;","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/flannel.ts#L99-L135","documentation":"Thrown by validateFlannelParams when the resolved flannel 'size' is <= 0. 'size' is the spacing (in pixels) of the woven plaid pattern; zero or negative spacing would divide by zero inside the shader's repeating coordinates. amount and softness are unit-interval values validated separately.","triggerScenarios":"flannel({size: 0}), flannel({size: -10}), or computing size from an animation that reaches zero.","commonSituations":"Animation that ramps size down to zero for a 'pattern collapse' effect; passing a relative scale factor that can be zero; off-by-one default of 0 instead of a positive pixel value.","solutions":["Pass a positive pixel size: flannel({size: 8}).","Clamp animated size: Math.max(1, value).","Omit size to use the documented default."],"exampleFix":"// before\nflannel({size: frame === 0 ? 0 : 8});\n// after\nflannel({size: Math.max(1, frame === 0 ? 4 : 8)});","handlingStrategy":"validation","validationCode":"const size = animatedSize <= 0 ? 8 : animatedSize;\nflannel({size});","typeGuard":"const isPositive = (v: unknown): v is number =>\n  typeof v === 'number' && Number.isFinite(v) && v > 0;","tryCatchPattern":null,"preventionTips":["Clamp animated size with Math.max(1, value).","Treat size as pixels (positive integer-ish) rather than a normalized scale.","Omit size to use the documented default."],"tags":["validation","flannel","effects","positive-number"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}