remotion-dev/remotion · error · TypeError
maxRetries should be an integer, but is ${maxRetries}.
Error message
maxRetries should be an integer, but is ${maxRetries}. What it means
Thrown by validateMaxRetries() when maxRetries is a finite, non-negative number but not an integer (maxRetries % 1 !== 0). The Cloud Run retry logic requires a whole number of attempts, so fractional values like 1.5 are rejected.
Source
Thrown at packages/cloudrun/src/shared/validate-retries.ts:23
throw new TypeError(
'maxRetries must be a number, but is ' + JSON.stringify(maxRetries),
);
}
if (!Number.isFinite(maxRetries)) {
throw new TypeError('maxRetries must be finite, but is ' + maxRetries);
}
if (Number.isNaN(maxRetries)) {
throw new TypeError('maxRetries is NaN');
}
if (maxRetries < 0) {
throw new TypeError(`maxRetries cannot be negative but is ${maxRetries}`);
}
if (maxRetries % 1 !== 0) {
throw new TypeError(
`maxRetries should be an integer, but is ${maxRetries}.`,
);
}
}
View on GitHub (pinned to 78fe4bb3fd)
Solutions
- Round explicitly with Math.round(), Math.floor(), or Math.trunc() before passing.
- Re-express the computation so it yields a whole number (e.g. use a count, not a ratio).
- Validate with Number.isInteger() upstream.
Example fix
// before const maxRetries = total * 0.1; // e.g. 1.5 // after const maxRetries = Math.max(0, Math.round(total * 0.1));
Defensive patterns
Strategy: validation
Validate before calling
if (typeof maxRetries === 'number' && maxRetries % 1 !== 0) {
throw new RangeError(`maxRetries must be an integer: ${maxRetries}`);
} Type guard
const isRetryCount = (v: unknown): v is number => typeof v === 'number' && Number.isFinite(v) && Number.isInteger(v) && v >= 0;
Prevention
- Round computed counts with Math.round()/Math.floor() before passing.
- Express retries as a count, not a ratio or percentage.
- Validate with Number.isInteger() in your own option parser.
When it happens
Trigger: Passing a float such as 1.5 or 2.7 as maxRetries; dividing two integers that does not yield a whole number; reading a decimal from config.
Common situations: Computing retries as a ratio or percentage (e.g. attempts = total * 0.1); using a float where an integer count was intended.
Related errors
- maxRetries must be finite, but is ${maxRetries}
- maxRetries is NaN
- maxRetries cannot be negative but is ${maxRetries}
- Bucket creation is required, but no region has been passed.
- Either cloudRunUrl or serviceName must be provided
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/9eefec8a5cf21fca.
Report an issue: GitHub.