tsc TS2554: Expected N arguments, but got M in CI
TS2554 is an arity error: the call passes a different number of arguments than the signature declares. It often appears after a function gains a required parameter that not every call site was updated for.
What this error means
tsc fails with "error TS2554: Expected 2 arguments, but got 1." (or the reverse), pointing at the call and noting which parameter was not provided.
src/app.ts:12:3 - error TS2554: Expected 2 arguments, but got 1.
12 connect(url);
~~~~~~~~~~~~
An argument for 'options' was not provided.Common causes
A required parameter was added to the signature
The function now declares a parameter that older call sites do not pass, so the call is short one argument.
A call passes more arguments than declared
Extra arguments are passed to a function with a fixed arity, which tsc rejects unless the signature uses a rest parameter.
How to fix it
Update the call to match the signature
- Read which parameter the error says was not provided.
- Pass the missing argument, or remove the extra one.
- Re-run tsc to confirm the arity matches.
connect(url, { timeout: 5000 });Make a new parameter optional when callers cannot all change
If you cannot update every call site at once, declare the added parameter optional with a default so existing calls remain valid.
function connect(url: string, options: Options = {}) { /* ... */ }How to prevent it
- Add new parameters as optional with a default when possible.
- Update all call sites in the same change as a signature change.
- Run tsc across the whole project, not just touched files.