TypeScript: error TS1192: Module '"./utils"' has no default export.
You used import x from "./mod" but the module only has named exports.
error TS1192: Module '"./utils"' has no default export.Module has no default export. ts(1192)TS1192 Module has no default exporterror TS1192 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
import { helper } from "./utils"- Add
export defaultif intended - Re-export defaults in barrels explicitly
Detailed fix by platform
TypeScript
export { default as Button } from "./Button";
How to diagnose
- Export — Default?
- Import — Matches?
- 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:
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
- ERR_IMPORT_ATTRIBUTE_MISSING TypeError [ERR_IMPORT_ATTRIBUTE_MISSING]: Module needs an import attribute of "type: json"
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