{"record":{"id":"81b60e45eee08f1c","repo":"remotion-dev/remotion","slug":"direction-passed-to-blurslide-must-be-one-of-v","errorCode":null,"errorMessage":"direction passed to blurSlide() must be one of ${VALID_DIRECTIONS.map((d) => `\"${d}\"`).join(', ')}, received ${JSON.stringify(direction)}","messagePattern":"direction passed to blurSlide\\(\\) must be one of (.+?)\"`\\)\\.join\\(', '\\)\\}, received (.+?)","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/transitions/src/presentations/blur-slide.tsx","lineNumber":190,"sourceCode":"\t\tcase 'from-left':\n\t\t\treturn [1, 0];\n\t\tcase 'from-right':\n\t\t\treturn [-1, 0];\n\t\tcase 'from-top':\n\t\t\treturn [0, 1];\n\t\tcase 'from-bottom':\n\t\t\treturn [0, -1];\n\t\tdefault:\n\t\t\tthrow new Error(`Invalid direction: ${direction}`);\n\t}\n};\n\nconst validateProps = (props: BlurSlideProps) => {\n\tconst direction = props.direction ?? DEFAULT_DIRECTION;\n\tconst blur = props.blur ?? DEFAULT_BLUR;\n\n\tif (!VALID_DIRECTIONS.includes(direction)) {\n\t\tthrow new TypeError(\n\t\t\t`direction passed to blurSlide() must be one of ${VALID_DIRECTIONS.map((d) => `\"${d}\"`).join(', ')}, received ${JSON.stringify(direction)}`,\n\t\t);\n\t}\n\n\tif (typeof blur !== 'number' || !Number.isFinite(blur)) {\n\t\tthrow new TypeError(\n\t\t\t`blur passed to blurSlide() must be a finite number, received ${blur}`,\n\t\t);\n\t}\n\n\tif (blur < 0) {\n\t\tthrow new TypeError(\n\t\t\t`blur passed to blurSlide() must be greater than or equal to 0, received ${blur}`,\n\t\t);\n\t}\n};\n\nexport const blurSlideShader = (","sourceCodeStart":172,"sourceCodeEnd":208,"githubUrl":"https://github.com/remotion-dev/remotion/blob/b2f4e34732f3c6c222ea029413e22dc402218cd7/packages/transitions/src/presentations/blur-slide.tsx#L172-L208","documentation":"validateProps throws a TypeError when the direction prop passed to blurSlide() is not one of the four valid string literals. Unlike error 93 this runs on the public blurSlide() entry point, so it is the primary defense against bad direction values.","triggerScenarios":"Calling blurSlide({direction: 'up'}), passing a non-string (number, null cast), or a misspelled direction through the presentation factory.","commonSituations":"Building transitions from dynamic config/UI selections; TypeScript omitted or value typed loosely; typos in direction names.","solutions":["Pass exactly 'from-left', 'from-right', 'from-top', or 'from-bottom'","Validate dynamic values against the union type before calling blurSlide()","Omit direction entirely to use DEFAULT_DIRECTION","Enable TypeScript strict mode so the union type rejects invalid literals at compile time"],"exampleFix":"// before\nblurSlide({direction: 'down'})\n// after\nblurSlide({direction: 'from-bottom'})","handlingStrategy":"validation","validationCode":"const dirs = ['from-left','from-right','from-top','from-bottom'] as const;\nif (!dirs.includes(props.direction as any)) {\n  throw new TypeError(`direction must be one of ${dirs.join(', ')}`);\n}","typeGuard":"const isBlurSlideDirection = (d: unknown): d is 'from-left'|'from-right'|'from-top'|'from-bottom' =>\n  typeof d === 'string' && ['from-left','from-right','from-top','from-bottom'].includes(d);","tryCatchPattern":"try {\n  presentation = blurSlide({direction: rawDirection as any});\n} catch (err) {\n  if (err instanceof TypeError && err.message.includes('direction passed to blurSlide()')) {\n    presentation = blurSlide({}); // default direction\n  }\n}","preventionTips":["Type props as the literal union so tsc rejects invalid values","Normalize/trim dynamic direction strings before use","Omit direction to accept the default","Add a unit test covering all four valid values"],"tags":["props","validation","typescript"],"backgroundTag":"invalid-enum-value","analyzedSha":"b2f4e34732f3c6c222ea029413e22dc402218cd7","analyzedAt":"2026-09-09T13:27:51.281Z","contentChangedAt":"2026-09-09T13:27:51.281Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}