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
Thrown by the emboss effect's internal validatePositive() (a TypeError) when a resolved `size` or `lineWidth` is <= 0. validateEmbossParams() calls validatePositive only on size and lineWidth after assertOptionalFiniteNumber has already guaranteed they are finite numbers. The relief pattern math requires strictly positive cell/dash dimensions, so zero or negative values are rejected up front.
Source
Thrown at packages/effects/src/emboss.ts:135
readonly uAngle: WebGLUniformLocation | null;
readonly uLightAngle: WebGLUniformLocation | null;
readonly uOffset: WebGLUniformLocation | null;
};
};
const resolve = (p: EmbossParams): EmbossResolved => ({
amount: p.amount ?? DEFAULT_AMOUNT,
size: p.size ?? DEFAULT_SIZE,
lineWidth: p.lineWidth ?? DEFAULT_LINE_WIDTH,
depth: p.depth ?? DEFAULT_DEPTH,
angle: p.angle ?? DEFAULT_ANGLE,
lightAngle: p.lightAngle ?? DEFAULT_LIGHT_ANGLE,
offset: p.offset ?? DEFAULT_OFFSET,
});
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 validateEmbossParams = (params: EmbossParams): void => {
assertEffectParamsObject(params, 'Emboss');
assertOptionalFiniteNumber(params.amount, 'amount');
assertOptionalFiniteNumber(params.size, 'size');
assertOptionalFiniteNumber(params.lineWidth, 'lineWidth');
assertOptionalFiniteNumber(params.depth, 'depth');
assertOptionalFiniteNumber(params.angle, 'angle');
assertOptionalFiniteNumber(params.lightAngle, 'lightAngle');
assertOptionalFiniteNumber(params.offset, 'offset');
const r = resolve(params);
validateUnitInterval(r.amount, 'amount');
validatePositive(r.size, 'size');View on GitHub (pinned to 78fe4bb3fd)
Solutions
- Pass a strictly positive value: keep size >= 1 and lineWidth >= 0.1 per the emboss schema.
- When animating, clamp with a floor, e.g. interpolate(...) then Math.max(1, size).
- If the value is computed, validate it before passing it to emboss().
- Leave the prop undefined to use the documented defaults (size 26, lineWidth 7).
Example fix
// before
emboss({size: frame > 30 ? 0 : 26})
// after
emboss({size: frame > 30 ? 1 : 26}) Defensive patterns
Strategy: validation
Validate before calling
// Validate size/lineWidth before calling emboss().
function isPositiveFinite(v: unknown): v is number {
return typeof v === 'number' && Number.isFinite(v) && v > 0;
}
function resolveEmbossDims(p: {size?: number; lineWidth?: number}) {
const size = p.size ?? 26;
const lineWidth = p.lineWidth ?? 7;
if (!isPositiveFinite(size)) throw new TypeError(`size must be > 0, got ${size}`);
if (!isPositiveFinite(lineWidth)) throw new TypeError(`lineWidth must be > 0, got ${lineWidth}`);
return {size, lineWidth};
} Type guard
function isValidEmbossPositive(v: unknown): v is number {
return typeof v === 'number' && Number.isFinite(v) && v > 0;
} Prevention
- Keep size >= 1 and lineWidth >= 0.1 (the emboss schema's documented minimums).
- When animating size/lineWidth, clamp with a floor: Math.max(1, value) / Math.max(0.1, value).
- Type props so the compiler warns on out-of-range literals.
- Omit the prop to use the safe defaults (size 26, lineWidth 7).
When it happens
Trigger: Calling emboss({size: 0}), emboss({size: -5}), emboss({lineWidth: 0}), or emboss({lineWidth: -1}). Also when a param is driven by an interpolate() or formula that crosses zero at some frame.
Common situations: Animating `size` or `lineWidth` through 0, deriving the value from a ratio that can hit zero, or a copy-paste typo. Note the schema documents size min=1 and lineWidth min=0.1, so values below those are out of the supported range.
Related errors
- "${name}" must be greater than 0, but got ${JSON.stringify(v
- "${name}" must be greater than or equal to 0, but got ${JSON
- "colors" must be an array with at least 2 colors, but got ${
- "${name}" must be ${formatEnum(variants)}, but got ${JSON.st
- "${name}" must be a boolean, but got ${JSON.stringify(value)
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/daf0935359a6aa02.
Report an issue: GitHub.