{"record":{"id":"f701b983c555d45a","repo":"remotion-dev/remotion","slug":"skew-supports-only-the-following-signatures-ske","errorCode":null,"errorMessage":"skew() supports only the following signatures:\nskew(angle: AngleUnitString): string;\nskew(angle: AngleUnitString, angle2: AngleUnitString): string;\nskew(angle: number, unit: AngleUnit): string;\nskew(angleX: number, angleY: number): string;\nskew(angleX: number, unitX: AngleUnit, angleY: number, unitY: AngleUnit): string;","messagePattern":"skew\\(\\) supports only the following signatures:\nskew\\(angle: AngleUnitString\\): string;\nskew\\(angle: AngleUnitString, angle2: AngleUnitString\\): string;\nskew\\(angle: number, unit: AngleUnit\\): string;\nskew\\(angleX: number, angleY: number\\): string;\nskew\\(angleX: number, unitX: AngleUnit, angleY: number, unitY: AngleUnit\\): string;","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/animation-utils/src/transformation-helpers/make-transform/transform-functions.ts","lineNumber":303,"sourceCode":"\t\t\treturn `skew(${arg1}deg, ${arg2}deg)`;\n\t\t}\n\t}\n\n\tif (arguments.length === 4) {\n\t\t// Case E\n\t\tif (\n\t\t\ttypeof arg1 === 'number' &&\n\t\t\tisUnitWithString(arg2, angleUnits) &&\n\t\t\ttypeof arg3 === 'number' &&\n\t\t\tisUnitWithString(arg4, angleUnits)\n\t\t) {\n\t\t\tcheckNumber({num: arg1, param: 'angle', api: 'skew'});\n\t\t\tcheckNumber({num: arg3, param: 'angle', api: 'skew'});\n\t\t\treturn `skew(${arg1}${arg2}, ${arg3}${arg4})`;\n\t\t}\n\t}\n\n\tthrow new TypeError(\n\t\t[\n\t\t\t'skew() supports only the following signatures:',\n\t\t\t'skew(angle: AngleUnitString): string;',\n\t\t\t'skew(angle: AngleUnitString, angle2: AngleUnitString): string;',\n\t\t\t'skew(angle: number, unit: AngleUnit): string;',\n\t\t\t'skew(angleX: number, angleY: number): string;',\n\t\t\t'skew(angleX: number, unitX: AngleUnit, angleY: number, unitY: AngleUnit): string;',\n\t\t].join('\\n'),\n\t);\n}\n\nfunction skewX(angle: AngleUnitString): string;\nfunction skewX(angle: number, unit?: AngleUnit): string;\nfunction skewX(angle: unknown, unit: AngleUnit = 'deg'): string {\n\tif (isUnitWithString(angle, angleUnits)) {\n\t\treturn `skewX(${angle})`;\n\t}\n","sourceCodeStart":285,"sourceCodeEnd":321,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/animation-utils/src/transformation-helpers/make-transform/transform-functions.ts#L285-L321","documentation":"`skew()` is implemented with `...args: unknown[]` and only handles 1, 2, or 4 arguments in specific type combinations (unit-string, number, or number+unit pairs). Any other arity (0, 3, 5+) or a type combination that matches no case (e.g. a plain non-unit string, or mismatched number/unit) falls through to this exhaustive signature list. The message lists every accepted signature.","triggerScenarios":"Calling `skew()` with no args; `skew(1, 2, 3)` (3 args); `skew('red')` (non-angle string); `skew(10, 'px')` (px is not an angle unit, only deg/grad/rad/turn are); `skew(10, 'deg', 'x')` (third arg wrong type); mixing a number with a non-unit value.","commonSituations":"Confusing `skew` with `translate`/`rotate` and passing length units (`px`) instead of angle units (`deg`); building transform strings from variable-length arrays that sometimes pass wrong arity; copy-paste from CSS where units are concatenated differently.","solutions":["Match your call to one of the listed signatures: `skew('30deg')`, `skew(30, 'deg')`, `skew(30, 10)`, or `skew(30, 'deg', 10, 'deg')`.","If passing a unit string, use an angle unit (deg, grad, rad, turn), not a length unit.","For variable arity, validate `args.length` is 1, 2, or 4 before calling.","Remove any `as any` so the overload signatures guide the call."],"exampleFix":"// before\nconst s = skew(30, 'px'); // px is not an angle unit\n\n// after\nconst s = skew(30, 'deg');","handlingStrategy":"validation","validationCode":"// Validate skew() arguments match a supported signature before calling.\nconst ANGLE_UNITS = ['deg', 'grad', 'rad', 'turn'] as const;\ntype AngleUnit = (typeof ANGLE_UNITS)[number];\nconst isAngleUnitString = (v: unknown): v is string =>\n  typeof v === 'string' &&\n  ANGLE_UNITS.some((u) => v.endsWith(u)) &&\n  Number.isFinite(Number(v.slice(0, -u.lengthPlaceholder)));\n\n// simpler: just call the supported overload directly and avoid dynamic arity.","typeGuard":"const isAngleUnit = (v: unknown): v is AngleUnit =>\n    typeof v === 'string' && (ANGLE_UNITS as readonly string[]).includes(v);\n\nconst isAngleUnitString = (v: unknown): v is string => {\n  if (typeof v !== 'string') return false;\n  return ANGLE_UNITS.some((u) => {\n    if (!v.endsWith(u)) return false;\n    return Number.isFinite(Number(v.slice(0, v.length - u.length)));\n  });\n};","tryCatchPattern":null,"preventionTips":["Call skew() with a single unit string (`'30deg'`) or the 4-arg number/unit form to avoid ambiguity.","Never pass length units (px, %) to skew; only deg/grad/rad/turn are angle units.","Avoid building skew() calls from variable-length arrays unless you validate arity is 1, 2, or 4.","Drop `as any` so the overload list guides the call."],"tags":["transform","skew","validation","runtime","overload"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}