{"record":{"id":"f64b37b80c6b825b","repo":"remotion-dev/remotion","slug":"polling-must-be-a-number-or-null-got-json-strin","errorCode":null,"errorMessage":"Polling must be a number or null, got ${JSON.stringify(\n\t\t\t\tinterval,\n\t\t\t)} instead.","messagePattern":"Polling must be a number or null, got (.+?) instead\\.","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/cli/src/config/webpack-poll.ts","lineNumber":7,"sourceCode":"const DEFAULT_WEBPACK_POLL = null;\n\nlet webpackPolling: number | null = DEFAULT_WEBPACK_POLL;\n\nexport const setWebpackPollingInMilliseconds = (interval: number | null) => {\n\tif (typeof interval !== 'number' && interval !== null) {\n\t\tthrow new TypeError(\n\t\t\t`Polling must be a number or null, got ${JSON.stringify(\n\t\t\t\tinterval,\n\t\t\t)} instead.`,\n\t\t);\n\t}\n\n\twebpackPolling = interval;\n};\n\nexport const getWebpackPolling = () => {\n\treturn webpackPolling;\n};\n","sourceCodeStart":1,"sourceCodeEnd":20,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/cli/src/config/webpack-poll.ts#L1-L20","documentation":"`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.","triggerScenarios":"Calling `Config.setWebpackPollingInMilliseconds('500')`, `setWebpackPollingInMilliseconds(true)`, or `setWebpackPollingInMilliseconds(undefined)`.","commonSituations":"Env-driven polling value that arrives as a string; config file value quoted by mistake; passing `0` to mean 'off' (use `null` instead).","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)`."],"exampleFix":"// before\nConfig.setWebpackPollingInMilliseconds(process.env.POLL);\n// after\nConfig.setWebpackPollingInMilliseconds(\n  process.env.POLL ? Number(process.env.POLL) : null,\n);","handlingStrategy":"type-guard","validationCode":"const raw = process.env.POLL;\nconst value = raw === undefined || raw === '' ? null : Number(raw);\nif (value !== null && (typeof value !== 'number' || Number.isNaN(value))) {\n  throw new Error(`POLL must be a number or null, got ${raw}`);\n}\nConfig.setWebpackPollingInMilliseconds(value);","typeGuard":"const isPollInput = (v: unknown): v is number | null =>\n  v === null || (typeof v === 'number' && Number.isFinite(v));","tryCatchPattern":null,"preventionTips":["Use `null`, not `0`, to disable polling.","Validate at the env boundary so untyped strings never reach typed setters."],"tags":["config","validation","typescript","webpack","polling"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}