Skip to content
Latchkey

TS1192: Module has no default export - in CI

You used a default import on a module that exports only named members (or a CommonJS module without interop).

What this error means

Type-checking fails with TS1192 naming the module that lacks a default export.

tsc
src/app.ts(1,8): error TS1192: Module '"./helpers"' has no default export.

Common causes

How to fix it

Use a named import

  1. Import the named member instead of a default
ts
import { helper } from './helpers'

Enable esModuleInterop for CJS defaults

  1. Turn on esModuleInterop so synthetic default imports work for CommonJS
tsconfig.json
{
  "compilerOptions": { "esModuleInterop": true }
}

How to prevent it

  • Match import style to the module shape and enable esModuleInterop when consuming CommonJS.

Frequently asked questions

What causes "TS1192 no default export"?
Type-checking fails with TS1192 naming the module that lacks a default export.
How do I fix TS1192 no default export?
Use a named import

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card