angular/angular-cli · warning

Error searching fallback Angular v

Error message

Error searching fallback Angular v${finalSearchedVersion} documentation: ${error}

What it means

After falling back to the stable docs version, the retry `performSearch` call itself threw. The tool logs this warning and will ultimately return the raw search titles without fetched content (or empty results).

Solutions

  1. Restore network access or configure proxy environment variables (HTTPS_PROXY).
  2. Retry the MCP doc search later.
  3. Check status of angular.dev/ai.dev endpoints from the same machine (curl).
  4. Use local Angular documentation instead of the MCP search tool.

Example fix

// before (blocked)
export HTTPS_PROXY=  # unset/broken proxy
// after
export HTTPS_PROXY=http://proxy.corp.example:8080
Defensive patterns

Strategy: retry

Validate before calling

const res = await fetch(url, { method: 'HEAD' }); if (!res.ok) throw new Error(`docs unreachable: ${res.status}`);

Type guard

function isAbortError(e: unknown): e is DOMException { return e instanceof DOMException && e.name === 'AbortError'; }

Try / catch

for (let i = 0; i < 3; i++) { try { return await performSearch(q, v); } catch (e) { if (i === 2) logger.warn(`fallback search failed: ${e}`); } }

Prevention

When it happens

Trigger: The fallback `performSearch(query, LATEST_KNOWN_DOCS_VERSION)` throws — network failure, HTTP error, or unparseable index response — after the primary search already failed or returned empty.

Common situations: Complete loss of internet access; DNS failure; blocked CDN endpoints in restricted corporate environments; transient docs service outage.

Related errors


AI-assisted analysis of angular/angular-cli@bb72145f9a (2026-08-30). Data as JSON: /api/errors/f454dbf42b828fee. Report an issue: GitHub.

Appendix: source

Thrown at packages/angular/cli/src/commands/mcp/tools/doc-search.ts:175

    let allHits: Record<string, unknown>[] | undefined;
    try {
      allHits = await performSearch(query, finalSearchedVersion);
    } catch (error) {
      logger.warn(`Error searching Angular v${finalSearchedVersion} documentation: ${error}`);
    }

    // If the initial search for a newer-than-stable version returns no results, it may be because
    // the index for that version doesn't exist yet. In this case, fall back to the latest known
    // stable version.
    if ((!allHits || allHits.length === 0) && finalSearchedVersion > LATEST_KNOWN_DOCS_VERSION) {
      logger.warn(
        `Documentation index for v${finalSearchedVersion} not found or empty. Falling back to v${LATEST_KNOWN_DOCS_VERSION}.`,
      );
      finalSearchedVersion = LATEST_KNOWN_DOCS_VERSION;
      try {
        allHits = await performSearch(query, finalSearchedVersion);
      } catch (error) {
        logger.warn(
          `Error searching fallback Angular v${finalSearchedVersion} documentation: ${error}`,
        );
      }
    }

    if (!allHits?.length) {
      return {
        content: [
          {
            type: 'text' as const,
            text: `No results found for query "${query}" in Angular v${finalSearchedVersion} documentation.`,
          },
        ],
        structuredContent: { results: [], searchedVersion: finalSearchedVersion },
      };
    }

    const structuredResults = [];

View on GitHub (pinned to bb72145f9a)