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
- Check what the module actually exports.
- Import the named symbol, or use a namespace import for the whole module.
- 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
tsc TS1259: Module can only be default-imported using esModuleInterop in CIFix tsc "error TS1259: Module 'X' can only be default-imported using the 'esModuleInterop' flag" in CI - a Co…
tsc TS2459: Module 'x' declares 'y' locally, but it is not exported in CIFix tsc "error TS2459: Module 'x' declares 'y' locally, but it is not exported" in CI - you imported a name t…
tsc TS4023: Exported variable 'x' has or is using name 'y' but cannot be named in CIFix tsc "error TS4023: Exported variable 'x' has or is using name 'y' from external module Z but cannot be na…