remotion-dev/remotion · error · TypeError
skew() supports only the following signatures: skew(angle: A
Error message
skew() supports only the following signatures: skew(angle: AngleUnitString): string; skew(angle: AngleUnitString, angle2: AngleUnitString): string; skew(angle: number, unit: AngleUnit): string; skew(angleX: number, angleY: number): string; skew(angleX: number, unitX: AngleUnit, angleY: number, unitY: AngleUnit): string;
What it means
`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.
Source
Thrown at packages/animation-utils/src/transformation-helpers/make-transform/transform-functions.ts:303
return `skew(${arg1}deg, ${arg2}deg)`;
}
}
if (arguments.length === 4) {
// Case E
if (
typeof arg1 === 'number' &&
isUnitWithString(arg2, angleUnits) &&
typeof arg3 === 'number' &&
isUnitWithString(arg4, angleUnits)
) {
checkNumber({num: arg1, param: 'angle', api: 'skew'});
checkNumber({num: arg3, param: 'angle', api: 'skew'});
return `skew(${arg1}${arg2}, ${arg3}${arg4})`;
}
}
throw new TypeError(
[
'skew() supports only the following signatures:',
'skew(angle: AngleUnitString): string;',
'skew(angle: AngleUnitString, angle2: AngleUnitString): string;',
'skew(angle: number, unit: AngleUnit): string;',
'skew(angleX: number, angleY: number): string;',
'skew(angleX: number, unitX: AngleUnit, angleY: number, unitY: AngleUnit): string;',
].join('\n'),
);
}
function skewX(angle: AngleUnitString): string;
function skewX(angle: number, unit?: AngleUnit): string;
function skewX(angle: unknown, unit: AngleUnit = 'deg'): string {
if (isUnitWithString(angle, angleUnits)) {
return `skewX(${angle})`;
}
View on GitHub (pinned to 78fe4bb3fd)
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.
Example fix
// before const s = skew(30, 'px'); // px is not an angle unit // after const s = skew(30, 'deg');
Defensive patterns
Strategy: validation
Validate before calling
// Validate skew() arguments match a supported signature before calling. const ANGLE_UNITS = ['deg', 'grad', 'rad', 'turn'] as const; type AngleUnit = (typeof ANGLE_UNITS)[number]; const isAngleUnitString = (v: unknown): v is string => typeof v === 'string' && ANGLE_UNITS.some((u) => v.endsWith(u)) && Number.isFinite(Number(v.slice(0, -u.lengthPlaceholder))); // simpler: just call the supported overload directly and avoid dynamic arity.
Type guard
const isAngleUnit = (v: unknown): v is AngleUnit =>
typeof v === 'string' && (ANGLE_UNITS as readonly string[]).includes(v);
const isAngleUnitString = (v: unknown): v is string => {
if (typeof v !== 'string') return false;
return ANGLE_UNITS.some((u) => {
if (!v.endsWith(u)) return false;
return Number.isFinite(Number(v.slice(0, v.length - u.length)));
});
}; Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- translate() supports only the following signatures: translat
- translate3d() supports only the following signatures: transl
- Argument passed to "${api}" for param "${param}" is undefine
- Argument passed to "${api}" for param "${param}" is ${JSON.s
- Argument passed to "${api}" for param "${param}" is ${JSON.s
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/f701b983c555d45a.
Report an issue: GitHub.