Skip to content
Latchkey

TS2305: Module has no exported member - in CI

You imported a named export that does not exist on the target module.

What this error means

Type-checking fails with TS2305 naming the member and the module it is missing from.

tsc
src/util.ts(2,10): error TS2305: Module './helpers' has no exported member 'formatDate'.

Common causes

How to fix it

Import the correct exported name

  1. Open the module and confirm the exact export name
  2. Update the import to match
ts
import { formatDate } from './helpers'

Align the dependency version with its types

  1. Match the package and its @types major versions
  2. Reinstall from a clean lockfile
shell
npm ls some-pkg @types/some-pkg

How to prevent it

  • Pin dependencies and their @types together, and rely on editor autocomplete to import real export names.

Frequently asked questions

What causes "TS2305 no exported member"?
Type-checking fails with TS2305 naming the member and the module it is missing from.
How do I fix TS2305 no exported member?
Import the correct exported name

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card