{"record":{"id":"3dad8fe3a0c77168","repo":"remotion-dev/remotion","slug":"biasamount-must-be-0-but-got-json-stringif","errorCode":null,"errorMessage":"\"biasAmount\" must be >= 0, but got ${JSON.stringify(r.biasAmount)}","messagePattern":"\"biasAmount\" must be >= 0, but got (.+?)","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/effects/src/noise-displacement.ts","lineNumber":258,"sourceCode":"\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() {\n\tvUv = aUv;\n\tgl_Position = vec4(aPos, 0.0, 1.0);\n}\n`;\n\nconst NOISE_DISPLACEMENT_FS = /* glsl */ `#version 300 es\nprecision highp float;","sourceCodeStart":240,"sourceCodeEnd":276,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/noise-displacement.ts#L240-L276","documentation":"The noiseDisplacement() effect's optional `biasAmount` prop (directional pull multiplier relative to strength) must be non-negative. This TypeError fires after resolve() applies the default of 0. Note that biasAmount is also constrained to <= 1 via the schema, but the runtime check here only guards the lower bound.","triggerScenarios":"Calling noiseDisplacement({ biasAmount: -0.5 }) or any negative number for biasAmount. biasAmount: 0 is valid and disables directional bias.","commonSituations":"Animation interpolation going negative; sign errors; expecting negative biasAmount to reverse the bias direction (use biasDirection in degrees for directional control instead).","solutions":["Use a non-negative value: noiseDisplacement({ biasAmount: 0.5 }) or biasAmount: 0 to disable bias.","To change bias direction, adjust biasDirection (in degrees) rather than using negative biasAmount.","Clamp animated values: biasAmount: Math.max(0, interpolatedValue).","Omit biasAmount to use the default of 0."],"exampleFix":"// before\nnoiseDisplacement({ center: [0.5, 0.5], radius: 0.5, biasAmount: -0.3 })\n\n// after\nnoiseDisplacement({ center: [0.5, 0.5], radius: 0.5, biasAmount: 0.3, biasDirection: 90 })","handlingStrategy":"validation","validationCode":"// Validate biasAmount before calling noiseDisplacement()\nif (params.biasAmount !== undefined && params.biasAmount < 0) {\n  throw new Error(`biasAmount must be >= 0, got ${params.biasAmount}`);\n}\nconst result = noiseDisplacement(params);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use biasDirection (degrees) to control the direction of bias, not negative biasAmount.","Set biasAmount: 0 (or omit) to disable directional bias entirely.","Clamp animated biasAmount 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"}