ruvnet/ruflo · error · PluginError

CIRCULAR_DEPENDENCY

CIRCULAR_DEPENDENCY

Error message

Circular dependency detected: ${cycle.join(' -> ')}

What it means

PluginLoader's DFS over the plugin dependency graph found a name already on the current visit stack, proving a cycle; the message spells out the full loop (A -> B -> ... -> A). No valid plugin load order exists for a cyclic graph, so loading aborts with CIRCULAR_DEPENDENCY.

Source

Thrown at v3/@claude-flow/shared/src/plugin-loader.ts:552

      if (level.length > 0) {
        levels.push(level);
      }
    }

    return levels;
  }

  /**
   * Detect circular dependencies
   */
  private detectCircularDependencies(graph: Map<string, DependencyNode>): void {
    const visited = new Set<string>();
    const stack = new Set<string>();

    const visit = (name: string, path: string[]): void => {
      if (stack.has(name)) {
        const cycle = [...path, name];
        throw new PluginError(
          `Circular dependency detected: ${cycle.join(' -> ')}`,
          name,
          'CIRCULAR_DEPENDENCY'
        );
      }

      if (visited.has(name)) {
        return;
      }

      visited.add(name);
      stack.add(name);

      const node = graph.get(name);
      if (node) {
        for (const dep of Array.from(node.dependencies)) {
          visit(dep, [...path, name]);
        }

View on GitHub (pinned to fa13ee4ad6)

Solutions

  1. Break the dependency cycle by removing one edge listed in the reported cycle.
  2. Refactor shared functionality into a new plugin that both sides depend on.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at v3/@claude-flow/shared/src/plugin-loader.ts:552 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of ruvnet/ruflo@fa13ee4ad6 (2026-08-18). Data as JSON: /api/errors/59064f7b8be17a97. Report an issue: GitHub.