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
- Import the named member instead of a default
ts
import { helper } from './helpers'Enable esModuleInterop for CJS defaults
- 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
TS2305: Module has no exported member - in CIFix "error TS2305: Module 'x' has no exported member 'y'" when tsc runs in CI - an import name that the modul…
TS1259: Module can only be default-imported using esModuleInterop - in CIFix "error TS1259: Module ... can only be default-imported using the 'esModuleInterop' flag" when tsc runs in…
TS1128: Declaration or statement expected - in CIFix "error TS1128: Declaration or statement expected" when tsc runs in CI - a stray token, an extra brace, or…