{"record":{"id":"eeff7c079a3e7a65","repo":"remotion-dev/remotion","slug":"blur-must-be-0-but-got-json-stringify-r-bl","errorCode":null,"errorMessage":"\"blur\" must be >= 0, but got ${JSON.stringify(r.blur)}","messagePattern":"\"blur\" must be >= 0, but got (.+?)","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/effects/src/noise-displacement.ts","lineNumber":251,"sourceCode":"\tassertOptionalFiniteNumber(params.biasDirection, 'biasDirection');\n\tassertOptionalFiniteNumber(params.biasAmount, 'biasAmount');\n\n\tconst r = resolve(params);\n\tvalidateUnitInterval(r.center[0], 'center[0]');\n\tvalidateUnitInterval(r.center[1], 'center[1]');\n\tvalidatePositive(r.radius, 'radius');\n\tvalidateUnitInterval(r.radius, 'radius');\n\tif (r.strength < 0) {\n\t\tthrow new TypeError(\n\t\t\t`\"strength\" must be >= 0, but got ${JSON.stringify(r.strength)}`,\n\t\t);\n\t}\n\n\tvalidatePositive(r.grainSize, 'grainSize');\n\tvalidatePositive(r.passes, 'passes');\n\tvalidateMax(r.passes, MAX_PASSES, 'passes');\n\tif (r.blur < 0) {\n\t\tthrow new TypeError(\n\t\t\t`\"blur\" must be >= 0, but got ${JSON.stringify(r.blur)}`,\n\t\t);\n\t}\n\n\tvalidateUnitInterval(r.feather, 'feather');\n\tif (r.biasAmount < 0) {\n\t\tthrow new TypeError(\n\t\t\t`\"biasAmount\" must be >= 0, but got ${JSON.stringify(r.biasAmount)}`,\n\t\t);\n\t}\n};\n\nconst NOISE_DISPLACEMENT_VS = /* glsl */ `#version 300 es\nin vec2 aPos;\nin vec2 aUv;\nout vec2 vUv;\n\nvoid main() {","sourceCodeStart":233,"sourceCodeEnd":269,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/noise-displacement.ts#L233-L269","documentation":"The noiseDisplacement() effect's optional `blur` prop (additional local blur in pixels) must be non-negative. This TypeError fires when an explicitly negative blur is provided, after resolve() applies the default of 0. Blur adds a softening effect to the displaced samples.","triggerScenarios":"Calling noiseDisplacement({ blur: -5 }) or any negative number for blur. blur: 0 is valid and is the default.","commonSituations":"Animation interpolation crossing zero into negatives; sign errors in computed values; misunderstanding blur as a directional parameter.","solutions":["Use a non-negative value: noiseDisplacement({ blur: 2 }) or blur: 0 for no blur.","Clamp animated values: blur: Math.max(0, interpolatedValue).","Omit blur to use the default of 0."],"exampleFix":"// before\nnoiseDisplacement({ center: [0.5, 0.5], radius: 0.5, blur: -3 })\n\n// after\nnoiseDisplacement({ center: [0.5, 0.5], radius: 0.5, blur: 3 })","handlingStrategy":"validation","validationCode":"// Validate blur before calling noiseDisplacement()\nif (params.blur !== undefined && params.blur < 0) {\n  throw new Error(`blur must be >= 0, got ${params.blur}`);\n}\nconst result = noiseDisplacement(params);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use blur: 0 (or omit) for no blur — negative values are invalid.","Clamp animated blur values with Math.max(0, value).","Blur is in pixels, not a fraction — typical values are small (0–10)."],"tags":["validation","typescript","noise-displacement","params","typeerror"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}