{"record":{"id":"d3f468278b90b877","repo":"remotion-dev/remotion","slug":"parameter-timeoutinseconds-must-be-a-number-but","errorCode":null,"errorMessage":"parameter 'timeoutInSeconds' must be a number, but got a ${typeof timeoutInSeconds}","messagePattern":"parameter 'timeoutInSeconds' must be a number, but got a (.+?)","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/lambda/src/shared/validate-timeout.ts","lineNumber":5,"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);","sourceCodeStart":1,"sourceCodeEnd":23,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/lambda/src/shared/validate-timeout.ts#L1-L23","documentation":"Thrown by validateTimeout() in @remotion/lambda when the 'timeoutInSeconds' option is not a number. This is the per-function execution timeout (in whole seconds) used when deploying the Remotion Lambda function; valid range is MIN_TIMEOUT (15) to MAX_TIMEOUT (900).","triggerScenarios":"Calling deployFunction() (or any API that propagates timeoutInSeconds) with a non-number value: a string like '120', undefined (when not defaulted), null, or an object.","commonSituations":"Reading the timeout from a JSON/YAML config or env var and passing the raw string; allowing the field to be optional without a default; passing undefined because the field name was misspelled.","solutions":["Pass a number literal: timeoutInSeconds: 120.","Coerce from config: const timeoutInSeconds = Number(config.timeout); then verify it is a finite integer in [15,900].","If using env vars, parse and validate before passing."],"exampleFix":"// before\nawait deployFunction({ timeoutInSeconds: process.env.LAMBDA_TIMEOUT }); // string | undefined\n\n// after\nconst timeoutInSeconds = Number(process.env.LAMBDA_TIMEOUT) || 120;\nawait deployFunction({ timeoutInSeconds });","handlingStrategy":"validation","validationCode":"const raw = Number(config.timeout);\nconst timeoutInSeconds = Number.isFinite(raw) ? raw : 120; // then validate range/integer","typeGuard":"const isNumber = (v: unknown): v is number => typeof v === 'number';","tryCatchPattern":null,"preventionTips":["Type timeoutInSeconds as number in config schemas (not string).","Always pair the field with a numeric default.","Convert env vars with Number() and check isFinite before passing."],"tags":["lambda","validation","timeout","configuration","deploy"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}