{"record":{"id":"835f9070fb90de49","repo":"remotion-dev/remotion","slug":"name-must-be-1-but-got-json-stringify-v-835f90","errorCode":null,"errorMessage":"\"${name}\" must be >= 1, but got ${JSON.stringify(value)}","messagePattern":"\"(.+?)\" must be >= 1, but got (.+?)","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/effects/src/venetian-blinds.ts","lineNumber":106,"sourceCode":"\t\t);\n\t}\n};\n\nconst resolve = (p: VenetianBlindsParams): VenetianBlindsResolved => ({\n\tprogress: p.progress ?? DEFAULT_PROGRESS,\n\tdirection: p.direction ?? DEFAULT_DIRECTION,\n\tslats: p.slats ?? DEFAULT_SLATS,\n});\n\nconst validatePositiveInteger = (value: number, name: string): void => {\n\tif (!Number.isInteger(value)) {\n\t\tthrow new TypeError(\n\t\t\t`\"${name}\" must be an integer, but got ${JSON.stringify(value)}`,\n\t\t);\n\t}\n\n\tif (value < 1) {\n\t\tthrow new TypeError(\n\t\t\t`\"${name}\" must be >= 1, but got ${JSON.stringify(value)}`,\n\t\t);\n\t}\n};\n\nconst validateVenetianBlindsParams = (params: VenetianBlindsParams): void => {\n\tassertEffectParamsObject(params, 'Venetian blinds');\n\tassertOptionalFiniteNumber(params.progress, 'progress');\n\tassertOptionalFiniteNumber(params.slats, 'slats');\n\tassertOptionalEnum(params.direction, 'direction', VENETIAN_BLINDS_DIRECTIONS);\n\n\tconst r = resolve(params);\n\tvalidateUnitInterval(r.progress, 'progress');\n\tvalidatePositiveInteger(r.slats, 'slats');\n};\n\ntype VenetianBlindsState = {\n\treadonly gl: WebGL2RenderingContext;","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/venetian-blinds.ts#L88-L124","documentation":"Thrown by the venetian-blinds effect's validatePositiveInteger when the slats parameter is an integer but is less than 1. This is the second check in validatePositiveInteger (after the integer check), enforcing the schema minimum of 1. A value of 0 or negative triggers this even though it passes Number.isInteger.","triggerScenarios":"Calling venetianBlinds({slats: 0}) or venetianBlinds({slats: -3}). Zero and negatives are integers but are meaningless for blind slat counts.","commonSituations":"Computed slat count from a formula that can reach zero (e.g. Math.floor(width / veryLargeNumber)); user input of 0; default-from-config that was set to 0 by mistake.","solutions":["Pass a positive integer: venetianBlinds({slats: 12})","Clamp computed values to at least 1: venetianBlinds({slats: Math.max(1, Math.round(value))})","Omit slats to accept the default of 12","Check the schema range: slats must be between 1 and 100 inclusive"],"exampleFix":"// before\nconst e = venetianBlinds({slats: Math.floor(width / 1000)});\n\n// after\nconst e = venetianBlinds({slats: Math.max(1, Math.floor(width / 1000))});","handlingStrategy":"validation","validationCode":"function isPositiveInteger(value: unknown): boolean {\n  return typeof value === 'number' && Number.isInteger(value) && value >= 1;\n}\n\n// Before calling:\nif (!isPositiveInteger(params.slats)) {\n  throw new Error('slats must be a positive integer >= 1');\n}\nconst e = venetianBlinds(params);","typeGuard":"function isPositiveInteger(value: unknown): value is number {\n  return typeof value === 'number' && Number.isInteger(value) && value >= 1;\n}","tryCatchPattern":null,"preventionTips":["Clamp computed slat counts to at least 1: Math.max(1, Math.round(value))","Validate user input cannot produce 0 or negative slat counts","Check the schema range: slats must be 1–100 inclusive","Omit slats to accept the safe default of 12"],"tags":["validation","typescript","params","typeerror","range","venetian-blinds"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}