TypeScript: error TS2393: Duplicate function implementation.
A function with the same name/signature is implemented more than once in the same scope.
error TS2393: Duplicate function implementation.TS2393: Duplicate function implementationts(2393) Duplicate function implementationerror TS2393 Duplicate function implementation 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
- Keep one implementation
- Overloads: signatures only, then one implementation
- Add
export {}to turn scripts into modules
Detailed fix by platform
TypeScript
function f(a: string): string; function f(a: number): number; function f(a: any) { return a; }
How to diagnose
- Duplicates — Where?
- Overloads — Single impl?
- Files — Modules?
🔧 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.
- TS2300: Duplicate identifier TypeScript: error TS2300: Duplicate identifier 'Foo'.
Most viewed in TypeScript
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