{"record":{"id":"73ba9e9d4f10bcdb","repo":"remotion-dev/remotion","slug":"name-must-be-formatenum-variants-but-got-73ba9e","errorCode":null,"errorMessage":"\"${name}\" must be ${formatEnum(variants)}, but got ${JSON.stringify(value)}","messagePattern":"\"(.+?)\" must be (.+?), but got (.+?)","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/effects/src/venetian-blinds.ts","lineNumber":86,"sourceCode":"\t}\n\n\treturn `${variants\n\t\t.slice(0, -1)\n\t\t.map((variant) => `\"${variant}\"`)\n\t\t.join(', ')} or \"${variants[variants.length - 1]}\"`;\n};\n\nconst assertOptionalEnum = <T extends string>(\n\tvalue: unknown,\n\tname: string,\n\tvariants: readonly T[],\n): void => {\n\tif (value === undefined) {\n\t\treturn;\n\t}\n\n\tif (!variants.includes(value as T)) {\n\t\tthrow new TypeError(\n\t\t\t`\"${name}\" must be ${formatEnum(variants)}, but got ${JSON.stringify(value)}`,\n\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","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/venetian-blinds.ts#L68-L104","documentation":"Thrown by the venetian-blinds effect's assertOptionalEnum when the direction parameter is provided but is not one of the allowed values ('vertical' or 'horizontal'). Undefined is allowed (defaults to 'vertical'); any other string or non-string value fails. The message uses formatEnum to render the allowed values as a human-readable list.","triggerScenarios":"Calling venetianBlinds({direction: 'diagonal'}) or venetianBlinds({direction: 0}) or venetianBlinds({direction: 'Vertical'}) — note the case sensitivity; only lowercase 'vertical' and 'horizontal' are valid.","commonSituations":"Developer guesses a direction name not in the enum; capitalization mismatch ('Vertical' vs 'vertical'); data from a dropdown or external source using a different vocabulary; typo in the string.","solutions":["Use one of the two valid values: venetianBlinds({direction: 'vertical'}) or venetianBlinds({direction: 'horizontal'})","Omit direction entirely to accept the default ('vertical')","If consuming user input, map it to the canonical enum values before passing","Use the VenetianBlindsDirection TypeScript type to catch invalid values at compile time"],"exampleFix":"// before\nconst e = venetianBlinds({direction: 'diagonal'});\n\n// after\nconst e = venetianBlinds({direction: 'horizontal'});","handlingStrategy":"validation","validationCode":"const VALID_DIRECTIONS = ['vertical', 'horizontal'] as const;\n\nfunction isValidDirection(value: unknown): boolean {\n  return value === undefined || VALID_DIRECTIONS.includes(value as any);\n}\n\n// Before calling:\nif (!isValidDirection(params.direction)) {\n  throw new Error(`direction must be 'vertical' or 'horizontal'`);\n}\nconst e = venetianBlinds(params);","typeGuard":"const VENETIAN_BLINDS_DIRECTIONS = ['vertical', 'horizontal'] as const;\ntype VenetianBlindsDirection = typeof VENETIAN_BLINDS_DIRECTIONS[number];\n\nfunction isVenetianBlindsDirection(\n  value: unknown,\n): value is VenetianBlindsDirection {\n  return (\n    value === 'vertical' || value === 'horizontal'\n  );\n}","tryCatchPattern":null,"preventionTips":["Use only lowercase 'vertical' or 'horizontal' — the check is case-sensitive","Import the VenetianBlindsDirection type to get compile-time safety","Map external/user vocabulary to the canonical enum values before passing","Omit direction to accept the default 'vertical'"],"tags":["validation","typescript","params","typeerror","enum","venetian-blinds"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}