Skip to content
Latchkey

tsc TS2769: No overload matches this call in CI

TS2769 means the function or constructor has several overloads and your arguments fit none of them. tsc lists each overload and explains why each one was rejected.

What this error means

tsc fails with "error TS2769: No overload matches this call." followed by "Overload 1 of N, ..., gave the following error" entries for each candidate signature.

tsc
src/server.ts:8:1 - error TS2769: No overload matches this call.
  Overload 1 of 3, '(port: number, hostname?: string): Server', gave the following error.
    Argument of type 'string' is not assignable to parameter of type 'number'.

8 server.listen('3000');
  ~~~~~~~~~~~~~~~~~~~~~~

Common causes

The argument types match no declared overload

Each overload requires a specific argument shape; passing, for example, a string where every overload expects a number fits none of them.

A mismatched options object for an overloaded API

Overloaded library calls (event listeners, fetch wrappers) reject an options object that is missing a required field or has a wrong type.

How to fix it

Match one overload exactly

  1. Read the per-overload errors to find the closest candidate.
  2. Adjust the arguments to satisfy that overload precisely.
  3. Re-run tsc to confirm a single overload now matches.
src/server.ts
// pass a number, matching '(port: number, ...)'
server.listen(3000);

Coerce the argument to the expected type

When the value is correct but typed wrong, convert it so it satisfies an overload rather than casting blindly.

src/server.ts
server.listen(Number(process.env.PORT));

How to prevent it

  • Read all listed overloads before adjusting arguments.
  • Convert environment strings to the expected types at the boundary.
  • Prefer the typed API shape over as any to silence overload errors.

Related guides

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