remotion-dev/remotion · error · TypeError
Polling must be a number or null, got ${JSON.stringify(
Error message
Polling must be a number or null, got ${JSON.stringify(
interval,
)} instead. What it means
`Config.setWebpackPollingInMilliseconds()` accepts either a number (poll interval in ms) or `null` (disable polling, use filesystem events). Anything else — string, boolean, undefined — throws a TypeError echoing the JSON representation.
Source
Thrown at packages/cli/src/config/webpack-poll.ts:7
const DEFAULT_WEBPACK_POLL = null;
let webpackPolling: number | null = DEFAULT_WEBPACK_POLL;
export const setWebpackPollingInMilliseconds = (interval: number | null) => {
if (typeof interval !== 'number' && interval !== null) {
throw new TypeError(
`Polling must be a number or null, got ${JSON.stringify(
interval,
)} instead.`,
);
}
webpackPolling = interval;
};
export const getWebpackPolling = () => {
return webpackPolling;
};
View on GitHub (pinned to 78fe4bb3fd)
Solutions
- Pass a number in milliseconds: `Config.setWebpackPollingInMilliseconds(500)`.
- Pass `null` explicitly to disable polling: `Config.setWebpackPollingInMilliseconds(null)`.
- Coerce env strings: `Config.setWebpackPollingInMilliseconds(env.POLL ? Number(env.POLL) : null)`.
Example fix
// before Config.setWebpackPollingInMilliseconds(process.env.POLL); // after Config.setWebpackPollingInMilliseconds( process.env.POLL ? Number(process.env.POLL) : null, );
Defensive patterns
Strategy: type-guard
Validate before calling
const raw = process.env.POLL;
const value = raw === undefined || raw === '' ? null : Number(raw);
if (value !== null && (typeof value !== 'number' || Number.isNaN(value))) {
throw new Error(`POLL must be a number or null, got ${raw}`);
}
Config.setWebpackPollingInMilliseconds(value); Type guard
const isPollInput = (v: unknown): v is number | null => v === null || (typeof v === 'number' && Number.isFinite(v));
Prevention
- Use `null`, not `0`, to disable polling.
- Validate at the env boundary so untyped strings never reach typed setters.
When it happens
Trigger: Calling `Config.setWebpackPollingInMilliseconds('500')`, `setWebpackPollingInMilliseconds(true)`, or `setWebpackPollingInMilliseconds(undefined)`.
Common situations: Env-driven polling value that arrives as a string; config file value quoted by mistake; passing `0` to mean 'off' (use `null` instead).
Related errors
- Caching flag must be a boolean.
- setImageSequence accepts a Boolean Value
- outputLocation must be a string but got ${typeof newOutputLo
- Studio server port should be a number. Got ${typeof port} ($
- "fps" must be a number, but you passed a value of type ${typ
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/f64b37b80c6b825b.
Report an issue: GitHub.