# TypeScript: error TS2393: Duplicate function implementation.

**Code:** `TS2393: Duplicate function implementation` · **Category:** TypeScript · **Seen on:** TypeScript

A function with the same name/signature is implemented more than once in the same scope.

## Meaning

Remove one implementation or use overloads correctly (multiple signatures followed by a single implementation). Often caused by two script (non-module) files declaring the same global function, or duplicated code from merges. Make files modules with `export {}`.

## Common causes

- Duplicate function definitions
- Two global script files with the same function
- Overload signatures each with a body
- Merge conflict leftovers
- Copy-paste

## Quick fix

1. Keep one implementation
2. Overloads: signatures only, then one implementation
3. Add `export {}` to turn scripts into modules

## Detailed fix by platform

### TypeScript

1. `function f(a: string): string; function f(a: number): number; function f(a: any) { return a; }`

## How to diagnose

1. **Duplicates** — Where?
2. **Overloads** — Single impl?
3. **Files** — Modules?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/typescript/ts2393-duplicate-function-implementation)
