Skip to content
Latchkey

TS2554: Expected N arguments, but got M - in CI

You called a function with more or fewer arguments than its signature allows.

What this error means

Type-checking fails with TS2554 stating the expected and actual argument counts.

tsc
src/api.ts(22,5): error TS2554: Expected 2 arguments, but got 1.

Common causes

How to fix it

Pass the required arguments

  1. Supply every required argument the signature expects
ts
fetchUser(id, { signal })

Make a parameter optional or defaulted

  1. If the parameter is genuinely optional, mark it with ? or give a default
ts
function fetchUser(id: string, opts?: Options) {}

How to prevent it

  • Keep call sites in sync with signatures and run tsc --noEmit in CI to catch arity changes early.

Frequently asked questions

What causes "TS2554 argument count"?
Type-checking fails with TS2554 stating the expected and actual argument counts.
How do I fix TS2554 argument count?
Pass the required arguments

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card