TypeScript: error TS2769: No overload matches this call. Overload 1 of 2, '(a: string): void', gave the following error.
A call matched none of the function's overload signatures.
error TS2769: No overload matches this call.No overload matches this call. Overload 1 of 2 gave the following errorTS2769 No overload matches this callts(2769) No overload matches this call Meaning
Read each overload's error: the last or most relevant one explains which argument fails. Fix argument types (string vs number, undefined from optionals), narrow values first, or pass options in the right shape. In React (useState, style, event handlers), a wrong prop type triggers it.
Common causes
- Argument types don't match any overload
- Possibly
undefinedvalue passed - Wrong options object shape
- Library overloads changed in upgrade
- Event handler types mismatch
⚡ Quick fix
- Narrow/convert arguments to the expected type
- Read each overload's message (the 2nd line)
- Check library version typings
Detailed fix by platform
TypeScript
const el = document.getElementById("a"); if (el) el.addEventListener("click", handler);
How to diagnose
- Overloads — Which fail?
- Argument — Undefined/wrong?
- Version — Typings?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- Cannot find module './App.vue' or its corresponding type declarations TypeScript: error TS2307: Cannot find module './App.vue' or its corresponding type declarations.
- TS1005: ';' expected / ',' expected (syntax error) TypeScript: error TS1005: ';' expected.
- TS1128: Declaration or statement expected TypeScript: error TS1128: Declaration or statement expected.
Most viewed in TypeScript
- TS2564 TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor
- TS7006 TS7006: Parameter 'x' implicitly has an 'any' type
- TS2366: Function lacks ending return statement TypeScript: error TS2366: Function lacks ending return statement and return type does not include 'undefined'.
Other ways to find it
Where this error sits
Origin: On your device. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 5 Nov 2026