remotion-dev/remotion · error · TypeError
"${name}" must be greater than 0, but got ${JSON.stringify(v
Error message
"${name}" must be greater than 0, but got ${JSON.stringify(value)} What it means
The rings effect validates that certain numeric parameters (such as thickness) are strictly greater than 0. If a value of 0 or a negative number is supplied, the effect throws a TypeError with the parameter name and the offending value. This fires after type coercion, so it strictly catches range violations on valid finite numbers.
Source
Thrown at packages/effects/src/rings.ts:142
};
const resolve = (p: RingsParams): RingsResolved => {
const thickness = p.thickness ?? DEFAULT_THICKNESS;
const gap = p.gap ?? DEFAULT_GAP;
return {
colors: p.colors ?? DEFAULT_COLORS,
center: [...(p.center ?? DEFAULT_CENTER)] as RingsCenter,
thickness,
spacing: thickness + gap,
offset: p.offset ?? DEFAULT_OFFSET,
maskToSourceAlpha: p.maskToSourceAlpha ?? DEFAULT_MASK_TO_SOURCE_ALPHA,
};
};
const validatePositive = (value: number, name: string): void => {
if (value <= 0) {
throw new TypeError(
`"${name}" must be greater than 0, but got ${JSON.stringify(value)}`,
);
}
};
const validateNonNegative = (value: number, name: string): void => {
if (value < 0) {
throw new TypeError(
`"${name}" must be greater than or equal to 0, but got ${JSON.stringify(value)}`,
);
}
};
const validateColors = (colors: unknown): void => {
if (colors === undefined) {
return;
}
View on GitHub (pinned to 78fe4bb3fd)
Solutions
- Pass a value strictly greater than 0 (e.g. thickness: 4 for a visible ring)
- Clamp computed values: thickness: Math.max(1, computedThickness)
- If the rings should not be visible, conditionally omit the effect rather than passing 0
- Animate towards a small positive epsilon instead of 0
Example fix
// before
rings({ thickness: 0 })
// after
rings({ thickness: Math.max(0.1, frame * 0.5) }) Defensive patterns
Strategy: validation
Validate before calling
const thickness = Math.max(0.1, frame * 0.5);
if (thickness <= 0) throw new Error('thickness must be > 0');
rings({ thickness }); Prevention
- Clamp positive-required parameters with Math.max(epsilon, value)
- Conditionally omit the rings effect when it should not be visible instead of passing 0
- Animate towards a small positive value, never exactly 0
When it happens
Trigger: Passing thickness: 0, thickness: -5, or any positive-required parameter with a non-positive number. The JSON.stringify in the message shows the exact value received.
Common situations: Passing 0 as an uninitialized/default value; computing thickness from a ratio that produces 0 at small scales; negative values from a subtractive animation formula; conditional rendering where the parameter should be omitted but 0 is passed instead.
Related errors
- "${name}" must be >= 1
- inputRange must contain only numbers
- outputStyles must contain only objects
- Argument passed to "${api}" for param "${param}" is undefine
- setImageSequence accepts a Boolean Value
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/618ebb384eb1ccbe.
Report an issue: GitHub.