TypeScript: error TS2614: Module '"./Button"' has no exported member 'Button'. Did you mean to use 'import Button from "./Button"' instead?
You used a named import for something that's a default export (or reverse).
error TS2614: Module '"./Button"' has no exported member 'Button'. Did you mean to use 'import Button from "./Button"' instead?Did you mean to use 'import x from' instead?TS2614 Module has no exported member. Did you mean to use import Meaning
Switch to import Button from "./Button" (default) or export it by name (export const Button). Pick one convention. For CommonJS libraries use import * as x/esModuleInterop.
Common causes
- Named import of a default export
- Default import of a named export
- Renamed export
- Barrel file exporting default incorrectly
- CJS/ESM interop
⚡ Quick fix
import Button from "./Button"orexport { Button }- Keep one convention per project
- Enable
esModuleInteropfor CJS defaults
Detailed fix by platform
TypeScript
export default function Button() { ... } // import Button from "./Button"
How to diagnose
- Export — Default/named?
- Import — Matches?
- Interop — Enabled?
🔧 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.
- Element type is invalid Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined
- Module not found: Can't resolve 'x' (Next.js build) Next.js: Module not found: Can't resolve '@/components/Button' / 'lodash' in '/app/src'
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