{"record":{"id":"794ecbd97df0045e","repo":"remotion-dev/remotion","slug":"parameter-disksizeinmb-must-be-between-min-eph","errorCode":null,"errorMessage":"parameter 'diskSizeInMb' must be between ${MIN_EPHEMERAL_STORAGE_IN_MB} and ${MAX_EPHEMERAL_STORAGE_IN_MB}, but got ${diskSizeInMb}","messagePattern":"parameter 'diskSizeInMb' must be between (.+?) and (.+?), but got (.+?)","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/lambda-client/src/validate-disk-size-in-mb.ts","lineNumber":27,"sourceCode":"\t\t\t`parameter 'diskSizeInMb' must be a number, got a ${typeof diskSizeInMb}`,\n\t\t);\n\t}\n\n\tif (Number.isNaN(diskSizeInMb)) {\n\t\tthrow new TypeError(`parameter 'diskSizeInMb' must not be NaN, but is`);\n\t}\n\n\tif (!Number.isFinite(diskSizeInMb)) {\n\t\tthrow new TypeError(\n\t\t\t`parameter 'diskSizeInMb' must be finite, but is ${diskSizeInMb}`,\n\t\t);\n\t}\n\n\tif (\n\t\tdiskSizeInMb < MIN_EPHEMERAL_STORAGE_IN_MB ||\n\t\tdiskSizeInMb > MAX_EPHEMERAL_STORAGE_IN_MB\n\t) {\n\t\tthrow new TypeError(\n\t\t\t`parameter 'diskSizeInMb' must be between ${MIN_EPHEMERAL_STORAGE_IN_MB} and ${MAX_EPHEMERAL_STORAGE_IN_MB}, but got ${diskSizeInMb}`,\n\t\t);\n\t}\n\n\tif (diskSizeInMb % 1 !== 0) {\n\t\tthrow new TypeError(\n\t\t\t`parameter 'diskSizeInMb' must be an integer but got ${diskSizeInMb}`,\n\t\t);\n\t}\n};\n","sourceCodeStart":9,"sourceCodeEnd":38,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/lambda-client/src/validate-disk-size-in-mb.ts#L9-L38","documentation":"Fourth guard in validateDiskSizeInMb: the value must fall within [MIN_EPHEMERAL_STORAGE_IN_MB (512), MAX_EPHEMERAL_STORAGE_IN_MB (10240)] inclusive, matching AWS Lambda's ephemeral storage bounds. Out-of-range values throw a TypeError naming the valid range.","triggerScenarios":"Calling validateDiskSizeInMb with a finite number outside 512-10240, e.g. 100, 0, 50000, or a value within range but stepped incorrectly (this specific check is range only).","commonSituations":"Requesting too little storage (< 512 MB, below AWS minimum); requesting more than 10 GB (above AWS maximum for Lambda ephemeral); copying on-prem disk sizing assumptions; config defaults set before AWS raised the limit.","solutions":["Set diskSizeInMb to a value between 512 and 10240 inclusive.","If you need more than 10 GB, mount EFS instead of relying on ephemeral storage.","Round up small values to the 512 MB minimum."],"exampleFix":"// before\nvalidateDiskSizeInMb(100);   // below minimum\nvalidateDiskSizeInMb(50000); // above maximum\n\n// after\nvalidateDiskSizeInMb(512);   // minimum\nvalidateDiskSizeInMb(10240); // maximum","handlingStrategy":"validation","validationCode":"import { MIN_EPHEMERAL_STORAGE_IN_MB, MAX_EPHEMERAL_STORAGE_IN_MB } from '@remotion/lambda-client';\nif (diskSizeInMb < MIN_EPHEMERAL_STORAGE_IN_MB || diskSizeInMb > MAX_EPHEMERAL_STORAGE_IN_MB) {\n  throw new RangeError(`diskSizeInMb must be ${MIN_EPHEMERAL_STORAGE_IN_MB}-${MAX_EPHEMERAL_STORAGE_IN_MB}`);\n}","typeGuard":"import { MIN_EPHEMERAL_STORAGE_IN_MB, MAX_EPHEMERAL_STORAGE_IN_MB } from '@remotion/lambda-client';\nconst isInRangeDisk = (v: unknown): v is number =>\n  typeof v === 'number' && v >= MIN_EPHEMERAL_STORAGE_IN_MB && v <= MAX_EPHEMERAL_STORAGE_IN_MB;","tryCatchPattern":null,"preventionTips":["Source MIN/MAX constants from the package rather than hardcoding.","Use EFS if you need more than 10 GB.","Clamp user-supplied values to the valid range in your UI."],"tags":["input-validation","disk","aws-limits","lambda"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}