TS2305: Module has no exported member

Module '"<package>"' has no exported member '<name>'.

TypeScript resolved the module you imported from, but the named export you asked for isn't in its type declarations. The module exists; that specific export doesn't, or doesn't anymore.

Why this happens in documentation specifically

In documentation this almost always means one thing: a major version removed an export that a code sample still imports. Nobody edited the sample when the export went away — docs are prose and code side by side, and only one half breaks in a way anyone notices.

The real example below is real released-package history: AI SDK 5 removed `AssistantResponse`. The docs page section is literally titled "Example," present-tense, no migration framing — a reader has no signal that this import stopped working.

A real example

ai@7.0.66
import { AssistantResponse } from "ai";
Module '"ai"' has no exported member 'AssistantResponse'.

How to fix it

Check the package's current export list — its `.d.ts` files or its own migration guide — for what replaced the removed export, if anything did. TS2305 alone doesn't tell you: it only says the name is gone, not what to use instead.

Unlike TS2724 and TS2551, there's no "Did you mean" here for TypeScript to get right or wrong — the compiler found nothing close enough to guess. That makes TS2305 slightly safer to trust at face value than its cousins, and slightly less helpful about what comes next.

Related codes

snippetcheck finds diagnostics like this one across a whole documentation site, not just a single sample — see how it works.