upstash/context7 · info
No libraries found matching "${library}"
Error message
No libraries found matching "${library}" What it means
In the docs command's library-search step, searchLibraries() returned successfully (no API error) but data.results is missing or empty. The TTY branch (spinner?.warn, line 74) prints this notice; exitCode is not set, so it is a benign 'no hits' outcome rather than a failure.
Source
Thrown at packages/cli/src/commands/docs.ts:74
let data;
try {
data = await resolveLibrary(library, query, accessToken);
} catch (err) {
spinner?.fail(`Error: ${err instanceof Error ? err.message : String(err)}`);
if (!spinner) log.error(err instanceof Error ? err.message : String(err));
process.exitCode = 1;
return;
}
if (data.error) {
spinner?.fail(data.message || data.error);
if (!spinner) log.error(data.message || data.error);
process.exitCode = 1;
return;
}
if (!data.results || data.results.length === 0) {
spinner?.warn(`No libraries found matching "${library}"`);
if (!spinner) log.warn(`No libraries found matching "${library}"`);
return;
}
const results = data.results;
spinner?.stop();
if (options.json) {
console.log(JSON.stringify(results, null, 2));
return;
}
log.blank();
if (data.searchFilterApplied) {
log.warn(
"Your results only include libraries matching your teamspace's library filters. To adjust quality thresholds or blocked libraries, update your filters at https://context7.com/dashboard?tab=policies"View on GitHub (pinned to 5284672feb)
Solutions
- Check spelling and use the canonical npm package name or GitHub /org/repo identifier
- Broaden the query: 'nextauth' instead of 'nextauth v4 magic link provider'
- If a filter notice was also shown, review quality thresholds at https://context7.com/dashboard?tab=policies
- Confirm the library exists in the registry by searching on context7.com
Example fix
# before context7 docs "next-autj" search # after context7 docs "nextauth" search
Defensive patterns
Strategy: validation
Validate before calling
// cheap pre-check: probe the registry with one keyword before scripting on results
const r = await fetch(`https://context7.com/api/v1/search?query=${encodeURIComponent(name)}`);
const data = await r.json();
if (!data.results?.length) { console.error(`no library "${name}" — check spelling`); process.exit(1); } Type guard
function hasResults<T>(r: { results?: T[]; error?: string }): r is { results: T[] } {
return !r.error && Array.isArray(r.results) && r.results.length > 0;
} Prevention
- Use canonical package names or /org/repo identifiers
- Start with a single distinctive keyword, then narrow
- Remember teamspace filters can hide matches — check the dashboard
When it happens
Trigger: Querying a typo'd or unregistered library name; queries too specific or in a format the registry does not index; all potential matches removed by the teamspace's library quality filters (searchFilterApplied).
Common situations: Misspelled package names; internal/private packages absent from the public registry; very new libraries not yet indexed; overly narrow multi-word queries.
Related errors
- No documentation found for: "${query}"
- searchResult.message || "Try a different description"
- Your results only include libraries matching your teamspace'
- Library has been redirected
- No skills found matching "${query}"
AI-assisted analysis of upstash/context7@5284672feb (2026-08-18).
Data as JSON: /api/errors/35cc3dc7c2020823.
Report an issue: GitHub.