ProjectStack
typescript

TS1192: Module 'X' has no default export

You're importing a module with default import syntax, but the module only has named exports. Default and named exports are different — a module must explicitly export something as default for you to import it without curly braces.

Common causes

  • The module uses only named exports but you're using a default import
  • Confusing a CommonJS module (module.exports = ...) with an ES module default export
  • The library changed from a default export to named exports in a newer version
  • Missing export default in your own module file

How to fix it

  1. Use named imports instead: import { SpecificThing } from 'module'
  2. Check the module's documentation for the correct import syntax
  3. If it's your own module, add export default to the file
  4. Import the entire module as a namespace: import * as MyModule from 'module'

Example

import lodash from 'lodash'; // error TS1192: Module '"lodash"' has no default export.

Importing lodash with default syntax — lodash uses named exports, not a default export

Browse more errors

The Developer Hub covers 150+ errors across Git, npm, Node.js, Python, TypeScript, and Docker — with plain-English explanations and fix steps.