{"record":{"id":"8f38c6d0881a7e40","repo":"remotion-dev/remotion","slug":"parameter-timeoutinseconds-must-not-be-nan-but","errorCode":null,"errorMessage":"parameter 'timeoutInSeconds' must not be NaN, but is","messagePattern":"parameter 'timeoutInSeconds' must not be NaN, but is","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/lambda/src/shared/validate-timeout.ts","lineNumber":11,"sourceCode":"import {MAX_TIMEOUT, MIN_TIMEOUT} from '@remotion/lambda-client/constants';\n\nexport const validateTimeout = (timeoutInSeconds: unknown) => {\n\tif (typeof timeoutInSeconds !== 'number') {\n\t\tthrow new TypeError(\n\t\t\t`parameter 'timeoutInSeconds' must be a number, but got a ${typeof timeoutInSeconds}`,\n\t\t);\n\t}\n\n\tif (Number.isNaN(timeoutInSeconds)) {\n\t\tthrow new TypeError(`parameter 'timeoutInSeconds' must not be NaN, but is`);\n\t}\n\n\tif (!Number.isFinite(timeoutInSeconds)) {\n\t\tthrow new TypeError(\n\t\t\t`parameter 'timeoutInSeconds' must be finite, but is ${timeoutInSeconds}`,\n\t\t);\n\t}\n\n\tif (timeoutInSeconds < MIN_TIMEOUT || timeoutInSeconds > MAX_TIMEOUT) {\n\t\tthrow new TypeError(\n\t\t\t`parameter 'timeoutInSeconds' must be between ${MIN_TIMEOUT} and ${MAX_TIMEOUT}, but got ${timeoutInSeconds}`,\n\t\t);\n\t}\n\n\tif (timeoutInSeconds % 1 !== 0) {\n\t\tthrow new TypeError(\n\t\t\t`parameter 'timeoutInSeconds' must be an integer but got ${timeoutInSeconds}`,\n\t\t);","sourceCodeStart":1,"sourceCodeEnd":29,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/lambda/src/shared/validate-timeout.ts#L1-L29","documentation":"Thrown by validateTimeout() in @remotion/lambda when timeoutInSeconds is the number NaN. The validator runs this check before the range/integer checks; a NaN timeout is meaningless for Lambda deployment. Unlike validate-retries.ts, here the NaN guard is ordered before the finite guard, so this message IS reachable for a NaN input.","triggerScenarios":"Passing timeoutInSeconds as the result of a NaN-producing expression: Number(undefined), parseInt(undefined), 0/0, or Math.sqrt(-1).","commonSituations":"Parsing an unset env var (Number(process.env.TIMEOUT) -> NaN), computing timeout from invalid input, or a malformed config value that fails Number conversion.","solutions":["Source timeoutInSeconds from a known numeric default, e.g. const timeoutInSeconds = parsed ?? 120.","Guard the parse: if (!Number.isFinite(Number(raw))) throw or default.","Verify env vars are set before converting them."],"exampleFix":"// before\nconst timeoutInSeconds = Number(process.env.LAMBDA_TIMEOUT); // NaN if unset\n\n// after\nconst raw = Number(process.env.LAMBDA_TIMEOUT);\nconst timeoutInSeconds = Number.isFinite(raw) ? raw : 120;","handlingStrategy":"validation","validationCode":"const raw = Number(process.env.LAMBDA_TIMEOUT);\nconst timeoutInSeconds = Number.isFinite(raw) ? Math.round(raw) : 120;","typeGuard":"const isFiniteNumber = (v: unknown): v is number =>\n  typeof v === 'number' && Number.isFinite(v);","tryCatchPattern":null,"preventionTips":["Verify env vars are set before Number()-converting them.","Default to a sane constant when the source is missing.","Run validateTimeout in preflight to fail fast."],"tags":["lambda","validation","timeout","configuration","deploy"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}