{"record":{"id":"35cc3dc7c2020823","repo":"upstash/context7","slug":"no-libraries-found-matching-library","errorCode":null,"errorMessage":"No libraries found matching \"${library}\"","messagePattern":"No libraries found matching \"(.+?)\"","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"packages/cli/src/commands/docs.ts","lineNumber":74,"sourceCode":"  let data;\n  try {\n    data = await resolveLibrary(library, query, accessToken);\n  } catch (err) {\n    spinner?.fail(`Error: ${err instanceof Error ? err.message : String(err)}`);\n    if (!spinner) log.error(err instanceof Error ? err.message : String(err));\n    process.exitCode = 1;\n    return;\n  }\n\n  if (data.error) {\n    spinner?.fail(data.message || data.error);\n    if (!spinner) log.error(data.message || data.error);\n    process.exitCode = 1;\n    return;\n  }\n\n  if (!data.results || data.results.length === 0) {\n    spinner?.warn(`No libraries found matching \"${library}\"`);\n    if (!spinner) log.warn(`No libraries found matching \"${library}\"`);\n    return;\n  }\n\n  const results = data.results;\n\n  spinner?.stop();\n\n  if (options.json) {\n    console.log(JSON.stringify(results, null, 2));\n    return;\n  }\n\n  log.blank();\n\n  if (data.searchFilterApplied) {\n    log.warn(\n      \"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\"","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/upstash/context7/blob/5284672feb575908efead6fcf1b5e542f8d607bb/packages/cli/src/commands/docs.ts#L56-L92","documentation":"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.","triggerScenarios":"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).","commonSituations":"Misspelled package names; internal/private packages absent from the public registry; very new libraries not yet indexed; overly narrow multi-word queries.","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"],"exampleFix":"# before\ncontext7 docs \"next-autj\" search\n\n# after\ncontext7 docs \"nextauth\" search","handlingStrategy":"validation","validationCode":"// cheap pre-check: probe the registry with one keyword before scripting on results\nconst r = await fetch(`https://context7.com/api/v1/search?query=${encodeURIComponent(name)}`);\nconst data = await r.json();\nif (!data.results?.length) { console.error(`no library \"${name}\" — check spelling`); process.exit(1); }","typeGuard":"function hasResults<T>(r: { results?: T[]; error?: string }): r is { results: T[] } {\n  return !r.error && Array.isArray(r.results) && r.results.length > 0;\n}","tryCatchPattern":null,"preventionTips":["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"],"tags":["search","cli","no-results","docs"],"backgroundTag":"empty-search-results","analyzedSha":"5284672feb575908efead6fcf1b5e542f8d607bb","analyzedAt":"2026-08-18T18:00:18.510Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}