No overload matches this call
Youβre calling a function with arguments that donβt match any of its overload signatures.
Why this happens
Some TypeScript functions define multiple overload signatures β different combinations of parameter types they accept. When none of the overloads match your arguments, TypeScript reports this error. Itβs common with DOM APIs, library functions, and generic utilities that have strict type constraints per overload.
Fix 1: Check the function signature
Hover over the function in your editor to see what arguments it expects.
// addEventListener has specific overloads
// β Wrong event name
element.addEventListener("clck", handler);
// β
Correct
element.addEventListener("click", handler);
Fix 2: Fix the callback signature
// β Wrong callback type
document.addEventListener("click", (e: KeyboardEvent) => {});
// β
Match the event type
document.addEventListener("click", (e: MouseEvent) => {});
Fix 3: Check library version
The overloads might have changed in a newer version. Check the libraryβs changelog.
Alternative solutions
If youβre writing your own overloaded function and hitting this error in tests, simplify by using a union type instead of overloads:
// Instead of multiple overloads
function parse(input: string): string;
function parse(input: number): number;
// β
Use a union
function parse(input: string | number): string | number {
return typeof input === 'string' ? input.trim() : input * 2;
}
Prevention
- Let TypeScript infer callback parameter types instead of annotating them manually β incorrect annotations are the most common cause.
- Keep
@types/*packages in sync with their corresponding library versions.
Related resources
Related: TypeScript: Type X Is Not Assignable to Type Y Β· What is TypeScript