Error AtlasError Documentation and Resolution

Module has no exported member

Module '"{0}"' has no exported member '{1}'.

TypeScript found an import that asks for a named export the target module does not actually export.

TS2305build
Module '"{0}"' has no exported member '{1}'.
  • A named import is being used for a symbol the module does not export.
  • The module exposes a default export but the import uses named export syntax.
  • The export name changed during a refactor but the import statement was not updated.
  1. Check the target module and import the exact exported member name.
  2. Use default import syntax only when the module exports a default value.
  3. For example, export const timeout = 5000 pairs with import { timeout } from './settings'. If the module instead uses export default timeout, import it without braces. Match the module's actual API rather than changing compiler settings to hide the diagnostic.
  4. If you import through an index file, confirm that it re-exports the symbol. A declaration in a child file is not automatically available from the package or directory entry point.
  5. For a dependency, check the installed version and its declaration files. Documentation for a newer release may describe exports your installed version does not provide.
  6. Run the project's type-check command again. If the editor and command line disagree, check which TypeScript version and tsconfig each uses before restarting the language service.
TypeScript Handbook: Modules
TS2305 Module has no exported member: causes and fixes | Error Atlas