{"record":{"id":"3a03c3f1485480e7","repo":"remotion-dev/remotion","slug":"name-must-be-greater-than-0-but-got-json-s-3a03c3","errorCode":null,"errorMessage":"\"${name}\" must be greater than 0, but got ${JSON.stringify(value)}","messagePattern":"\"(.+?)\" must be greater than 0, but got (.+?)","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/effects/src/noise-displacement.ts","lineNumber":206,"sourceCode":"\t\tthrow new TypeError(`\"${name}\" must be a [number, number] tuple`);\n\t}\n};\n\nconst assertOptionalIntegerNumber = (value: unknown, name: string): void => {\n\tif (value === undefined) {\n\t\treturn;\n\t}\n\n\tif (!Number.isInteger(value)) {\n\t\tthrow new TypeError(\n\t\t\t`\"${name}\" must be an integer, but got ${JSON.stringify(value)}`,\n\t\t);\n\t}\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 validateMax = (value: number, max: number, name: string): void => {\n\tif (value > max) {\n\t\tthrow new TypeError(\n\t\t\t`\"${name}\" must be <= ${max}, but got ${JSON.stringify(value)}`,\n\t\t);\n\t}\n};\n\nconst validateNoiseDisplacementParams = (\n\tparams: NoiseDisplacementParams,\n): void => {\n\tassertEffectParamsObject(params, 'Noise Displacement');\n\tassertRequiredUvCoordinate(params.center, 'center');","sourceCodeStart":188,"sourceCodeEnd":224,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/noise-displacement.ts#L188-L224","documentation":"validatePositive throws this TypeError when a noiseDisplacement parameter that must be strictly positive is zero or negative. It is applied to `radius` (line 239), `grainSize` (line 247), and `passes` (line 248) after defaults are resolved. The parameter name is interpolated into the message so you can identify which one failed.","triggerScenarios":"Calling noiseDisplacement with radius <= 0 (e.g. radius: 0 or radius: -0.5), grainSize <= 0 (after default resolution), or passes <= 0 (e.g. passes: 0). These are checked after resolve() applies defaults, so even omitted grainSize/passess that resolve to non-positive values would trigger it — but the defaults (8 and 6) are positive.","commonSituations":"Setting radius to 0 thinking it disables the effect (it doesn't — use strength: 0 instead); passing a computed radius that can go to zero or negative; animation interpolation that hits zero at the boundary; grainSize set to 0 expecting no grain.","solutions":["Use a positive value: radius must be > 0 and <= 1, grainSize must be > 0, passes must be > 0 and <= 12.","To disable the displacement effect, set strength: 0 rather than radius: 0.","Clamp computed values: radius: Math.max(0.001, computedRadius).","Check the error message to see which named parameter failed."],"exampleFix":"// before\nnoiseDisplacement({ center: [0.5, 0.5], radius: 0, strength: 36 })\n\n// after\nnoiseDisplacement({ center: [0.5, 0.5], radius: 0.5, strength: 36 })\n// to disable the effect visually, use strength: 0\nnoiseDisplacement({ center: [0.5, 0.5], radius: 0.5, strength: 0 })","handlingStrategy":"validation","validationCode":"// Validate positive params before calling noiseDisplacement()\nif (params.radius !== undefined && params.radius <= 0) {\n  throw new Error(`radius must be > 0, got ${params.radius}`);\n}\nif (params.grainSize !== undefined && params.grainSize <= 0) {\n  throw new Error(`grainSize must be > 0, got ${params.grainSize}`);\n}\nif (params.passes !== undefined && params.passes <= 0) {\n  throw new Error(`passes must be > 0, got ${params.passes}`);\n}\nconst result = noiseDisplacement(params);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["To visually disable displacement, set strength: 0 rather than radius: 0.","Clamp dynamically computed values with Math.max() to ensure positivity.","Check the error message to identify which parameter (radius, grainSize, or passes) failed."],"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"}