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}'.
  • The imported name is absent from the module's public exports, including its index or barrel file.
  • The target module has a default export, but the consumer uses named import braces.
  • A package update, typo, path alias, or stale declaration file makes the imported name differ from the installed public API.
  1. Read the exact module path and symbol in TS2305. Follow that path to the file or package entry point TypeScript resolves; do not assume it is the file you edited.
  2. For `export const timeout = 5000`, use `import { timeout } from './settings'`. For `export default timeout`, use `import timeout from './settings'` without braces.
  3. If importing from a barrel file such as `./index`, export the symbol from that entry point too. A child module's export is not automatically re-exported.
  4. For a package, compare the installed package and declaration versions with its documentation. Updating or downgrading an import can be safer than changing compiler interop options.
  5. Run the project's type-check command. If only your editor still reports TS2305, confirm that it uses the same tsconfig, TypeScript version, and installed dependencies as the command line.
TypeScript Handbook: Modules