TS2614: Module has no exported member — did you mean to use 'import x from' TypeScript Origin: On your device OSI layer 7 · Application Last updated 5 Nov 2026

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).

Exact message you may see 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
Seen on: TypeScript

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

  1. import Button from "./Button" or export { Button }
  2. Keep one convention per project
  3. Enable esModuleInterop for CJS defaults

Detailed fix by platform

TypeScript

  1. export default function Button() { ... } // import Button from "./Button"

How to diagnose

  1. Export — Default/named?
  2. Import — Matches?
  3. 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:

Where this error sits

Origin: On your device. Errors that are often confused with or caused by this one (click to open):

Cannot find module './App.vue' or its corresponding type declarations — TypeScript: error TS2307: Cannot find module './App.vue' or its corresponding type declarations. (Vue)Cannot find module '.…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 (React)Element type is inval…Module not found: Can't resolve 'x' (Next.js build) — Next.js: Module not found: Can't resolve '@/components/Button' / 'lodash' in '/app/src' (Next.js)Module not found: Can…Router.use middleware — TypeError: Router.use() requires a middleware function but got a Object (Node.js)Router.use middlewareTS1192: Module has no default export — TypeScript: error TS1192: Module '"./utils"' has no default export. (TypeScript)TS1192: Module has no…TS1208: File cannot be compiled under '--isolatedModules' because it is considered a global script file — TypeScript: error TS1208: 'index.ts' cannot be compiled under '--isolatedModules' because it is considered a global script file. Add an import, export, or an empty 'export {}' statement (TypeScript)TS1208: File cannot b…TS1259: Module can only be default-imported using the 'esModuleInterop' flag — TypeScript: error TS1259: Module '"express"' can only be default-imported using the 'esModuleInterop' flag (TypeScript)TS1259: Module can on…TS1484/TS1205: type must be imported using a type-only import — TypeScript: error TS1484: 'User' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled. (TypeScript)TS1484/TS1205: type m…TS2614: M…

Explore the map of this error Full error map →

🧠 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.