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.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →