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
- Open the module and confirm the exact export name
- Update the import to match
ts
import { formatDate } from './helpers'Align the dependency version with its types
- Match the package and its @types major versions
- Reinstall from a clean lockfile
shell
npm ls some-pkg @types/some-pkgHow 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
TS2307: Cannot find module - in CIFix "error TS2307: Cannot find module 'x' or its corresponding type declarations" when tsc runs in CI - a mis…
TS1192: Module has no default export - in CIFix "error TS1192: Module 'x' has no default export" when tsc runs in CI - a default import of a module that…
TS2304: Cannot find name - in CIFix "error TS2304: Cannot find name 'x'" when tsc runs in CI - a missing import, a missing lib/types entry, o…