{"record":{"id":"148780ad39da3b31","repo":"remotion-dev/remotion","slug":"strength-must-be-0-but-got-json-stringify","errorCode":null,"errorMessage":"\"strength\" must be >= 0, but got ${JSON.stringify(r.strength)}","messagePattern":"\"strength\" must be >= 0, but got (.+?)","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/effects/src/noise-displacement.ts","lineNumber":242,"sourceCode":"\tassertRequiredUvCoordinate(params.center, 'center');\n\tassertRequiredFiniteNumber(params.radius, 'radius');\n\tassertOptionalFiniteNumber(params.strength, 'strength');\n\tassertOptionalFiniteNumber(params.seed, 'seed');\n\tassertOptionalFiniteNumber(params.grainSize, 'grainSize');\n\tassertOptionalFiniteNumber(params.passes, 'passes');\n\tassertOptionalIntegerNumber(params.passes, 'passes');\n\tassertOptionalFiniteNumber(params.blur, 'blur');\n\tassertOptionalFiniteNumber(params.feather, 'feather');\n\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);","sourceCodeStart":224,"sourceCodeEnd":260,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/noise-displacement.ts#L224-L260","documentation":"The noiseDisplacement() effect's optional `strength` prop (maximum displacement in pixels at the center) must be non-negative. This TypeError is thrown after resolve() applies the default of 36, so it fires only when an explicitly negative strength is provided. Strength controls how far pixels are displaced.","triggerScenarios":"Calling noiseDisplacement({ strength: -10 }) or any negative number for strength. Note: strength: 0 is valid and effectively disables the displacement.","commonSituations":"Animation interpolation that dips below zero; negating a value by mistake; thinking negative strength reverses the displacement direction (it doesn't — use biasDirection/biasAmount for directional control).","solutions":["Use a non-negative value: noiseDisplacement({ strength: 36 }) or strength: 0 to disable.","Clamp animated values: strength: Math.max(0, interpolatedValue).","For directional control, use biasDirection and biasAmount instead of negative strength.","Omit strength to use the default of 36."],"exampleFix":"// before\nnoiseDisplacement({ center: [0.5, 0.5], radius: 0.5, strength: -10 })\n\n// after\nnoiseDisplacement({ center: [0.5, 0.5], radius: 0.5, strength: 10 })\n// to disable: strength: 0","handlingStrategy":"validation","validationCode":"// Validate strength before calling noiseDisplacement()\nif (params.strength !== undefined && params.strength < 0) {\n  throw new Error(`strength must be >= 0, got ${params.strength}`);\n}\nconst result = noiseDisplacement(params);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use strength: 0 to disable displacement rather than negative values.","For directional control, use biasDirection (degrees) and biasAmount instead of negative strength.","Clamp animated strength values with Math.max(0, value)."],"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"}