Error AtlasError Documentation and Resolution

Module has no default export

Module '"{0}"' has no default export.

A default import asks for a module's default export, but the resolved module does not declare one. Check its exports before changing interop settings.

TS1192build
Module '"{0}"' has no default export.
  • A file exports named values but the consuming file uses a default import.
  • An index file re-exports named members but does not forward a default export.
  • The import resolves to a different package entry or declaration file than expected.
  1. Open the resolved module. For export const settings = {}, use import { settings } from './settings' rather than import settings from './settings'.
  2. If you own the module and intend a default API, declare export default settings. Check existing consumers before changing the public export shape.
  3. Check barrel files: export * from './settings' does not forward its default export. Explicitly re-export the intended value, or import from its original module.
  4. For a third-party package, use the import form documented for the installed version. Do not assume a CommonJS interoperability option creates a real default export in an ES module.
  5. Run the project's type checker and execute the affected import in the target runtime. A passing type check is not sufficient if bundler and runtime module handling differ.
TypeScript Handbook: Modules
Fix TS1192: Module has no default export in TypeScript | Error Atlas