abhigyanpatwari/GitNexus · error

Analyzer dependency graph exceeded

Error message

Analyzer dependency graph exceeded ${limits.runtimeEdges} edges: ${packageRoot}

What it means

The dependency BFS enumerates every (parent, dependencyName) pair as an edge and enforces limits.runtimeEdges (default 100,000). The root package additionally folds in undeclared locally-linked dev dependencies (capped separately at 4 admissions). Exceeding the edge budget means the declared dependency graph is larger than any legitimate analyzer install, so the receipt computation aborts rather than silently truncating coverage — a truncated graph would make some runtime changes invisible to freshness checks.

Solutions

  1. Slim the analyzer package's declared dependency surface back to a normal closure; move unrelated deps out of the gitnexus manifest.
  2. Reinstall from the published package to restore the real dependency graph.
  3. In tests, keep traversalLimits.runtimeEdges above the fixture's edge count (overrides can never exceed 100,000).
Defensive patterns

Strategy: try-catch

Type guard

function isRuntimeEdgesLimitError(error: unknown): boolean {
  return error instanceof Error && /^Analyzer dependency graph exceeded \d+ edges:/.test(error.message);
}

Try / catch

try {
  identity = resolveAnalyzerRunnerIdentity(import.meta.url);
} catch (error) {
  if (isRuntimeEdgesLimitError(error)) {
    reportUserError('Dependency closure exceeds 100k edges; slim the manifest or reinstall the published package.');
  }
  throw error;
}

Prevention

When it happens

Trigger: A gitnexus install whose transitive declared-dependency closure (dependencies + optionalDependencies + peerDependencies + locally-linked dev deps) produces more than 100,000 edges — e.g. a fork that added enormous dependency trees, or a test that lowered runtimeEdges via traversalLimits while the fixture still enumerates a full graph.

Common situations: Forks bundling a whole application's deps into the analyzer package; test budget overrides that are too tight; corrupted installs where the manifest graph loops through aliased packages.

Related errors


AI-assisted analysis of abhigyanpatwari/GitNexus@52924ef12c (2026-08-20). Data as JSON: /api/errors/0308b2bf9c92fe9a. Report an issue: GitHub.

Appendix: source

Thrown at gitnexus/src/core/analyzer-identity.ts:1237

    const parent = queue[index];
    // The declared half is enumerated for every package; the resolved-location
    // half is scoped to the root package, where the 1998-resolution /
    // 8829-extra-guard blow-up documented on
    // `undeclaredLocalDevDependencyNames` cannot occur. Dropping this scope is
    // the expensive regression, so it is pinned by a guard-count test.
    const dependencies =
      parent.root === packageRoot
        ? [
            ...new Set([
              ...dependencyNames(parent.manifest),
              ...undeclaredLocalDevDependencyNames(parent, pathGuards, limits),
            ]),
          ].sort(compareBytes)
        : dependencyNames(parent.manifest);
    for (const dependencyName of dependencies) {
      budget.edges += 1;
      if (budget.edges > limits.runtimeEdges) {
        throw new Error(
          `Analyzer dependency graph exceeded ${limits.runtimeEdges} edges: ${packageRoot}`,
        );
      }
      const childRoot = resolveDependencyPackageRoot(
        parent.root,
        dependencyName,
        pathGuards,
        limits,
      );
      if (!childRoot) {
        edges.push({
          parentLocator: parent.locator,
          parentLabel: parent.label,
          dependencyName,
          childLocator: '<missing>',
          childLabel: '<missing>',
        });
        continue;

View on GitHub (pinned to 52924ef12c)