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.
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
- Read the per-overload errors to find the closest candidate.
- Adjust the arguments to satisfy that overload precisely.
- Re-run tsc to confirm a single overload now matches.
// 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.
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 anyto silence overload errors.