TS1192: Module has no default export TypeScript Origin: On your device OSI layer 7 · Application Last updated 5 Nov 2026

TypeScript: error TS1192: Module '"./utils"' has no default export.

You used import x from "./mod" but the module only has named exports.

Exact message you may see error TS1192: Module '"./utils"' has no default export.Module has no default export. ts(1192)TS1192 Module has no default exporterror TS1192
Seen on: TypeScript

Meaning

Use import { x } from "./mod" or add export default x. For CJS libs enable esModuleInterop. Barrel files: export { default as Foo } from "./Foo". Keep a consistent convention (named exports preferred for refactoring).

Common causes

  • Default import of named exports
  • Missing export default
  • Barrel file not re-exporting default
  • CJS interop
  • Renamed export

⚡ Quick fix

  1. import { helper } from "./utils"
  2. Add export default if intended
  3. Re-export defaults in barrels explicitly

Detailed fix by platform

TypeScript

  1. export { default as Button } from "./Button";

How to diagnose

  1. Export — Default?
  2. Import — Matches?
  3. Barrel — Re-exports?

🔧 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…ERR_IMPORT_ATTRIBUTE_MISSING — TypeError [ERR_IMPORT_ATTRIBUTE_MISSING]: Module needs an import attribute of "type: json" (Node.js)ERR_IMPORT_ATTRIBUTE_…ERR_PACKAGE_PATH_NOT_EXPORTED — Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './x' is not defined by "exports" (Node.js)ERR_PACKAGE_PATH_NOT_…ERR_REQUIRE_ESM — Error [ERR_REQUIRE_ESM]: require() of ES Module not supported (Node.js)ERR_REQUIRE_ESMERR_UNKNOWN_FILE_EXTENSION — TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" (Node.js)ERR_UNKNOWN_FILE_EXTE…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…not a constructor — TypeError: x is not a constructor (JavaScript)not a constructorTS1192: 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.