Skip to content
Latchkey

tsc TS1192: Module 'x' has no default export in CI

TS1192 means you wrote import X from 'mod' but the module declares only named exports and no default. tsc rejects the default binding because there is nothing to bind it to.

What this error means

tsc fails with "error TS1192: Module '\"x\"' has no default export." at a default import line.

tsc
src/app.ts:1:8 - error TS1192: Module '"./logger"' has no default export.

1 import logger from './logger';
         ~~~~~~

Common causes

The module exports named symbols only

The target has export const/export function but no export default, so a default import binds to nothing.

A default import used where a namespace import is needed

Some modules expose their API only as named exports; importing a default conflicts with that shape.

How to fix it

Use a named or namespace import

  1. Check what the module actually exports.
  2. Import the named symbol, or use a namespace import for the whole module.
  3. Re-run tsc to confirm the import resolves.
src/app.ts
import { logger } from './logger';
// or: import * as logger from './logger';

Add a default export if the module should provide one

If a default is the intended API, declare it in the source module.

src/logger.ts
// logger.ts
export default createLogger();

How to prevent it

  • Match import style to the module export shape.
  • Decide named-vs-default export conventions per package and keep them.
  • Let the editor autocomplete the correct import form.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →