# TypeScript: error TS2769: No overload matches this call. Overload 1 of 2, '(a: string): void', gave the following error.

**Code:** `TS2769: No overload matches this call` · **Category:** TypeScript · **Seen on:** TypeScript

A call matched none of the function's overload signatures.

## 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 `undefined` value passed
- Wrong options object shape
- Library overloads changed in upgrade
- Event handler types mismatch

## Quick fix

1. Narrow/convert arguments to the expected type
2. Read each overload's message (the 2nd line)
3. Check library version typings

## Detailed fix by platform

### TypeScript

1. `const el = document.getElementById("a"); if (el) el.addEventListener("click", handler);`

## How to diagnose

1. **Overloads** — Which fail?
2. **Argument** — Undefined/wrong?
3. **Version** — Typings?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/typescript/ts2769-no-overload-matches-this-call)
