davila7/claude-code-templates · warning

⚠️ Console Bridge initialization failed:

Error message

⚠️ Console Bridge initialization failed:

What it means

The Console Bridge integration inside ClaudeAnalytics failed during initialization (catch around setupConsoleBridgeIntegration and related setup). Analytics continue normally; only console interactions are disabled.

Source

Thrown at cli-tool/src/analytics.js:1559

        port: 3334,
        debug: false // Set to true for detailed debugging
      });
      
      // Initialize the bridge
      const success = await this.consoleBridge.initialize();
      
      if (success) {
        console.log(chalk.green('✅ Console Bridge initialized on port 3334'));
        console.log(chalk.cyan('🔌 Web interface can connect to ws://localhost:3334 for console interactions'));
        
        // Bridge console interactions to main WebSocket
        this.setupConsoleBridgeIntegration();
      } else {
        console.warn(chalk.yellow('⚠️ Console Bridge failed to initialize - console interactions disabled'));
      }
      
    } catch (error) {
      console.warn(chalk.yellow('⚠️ Console Bridge initialization failed:'), error.message);
      console.log(chalk.gray('Console interactions will not be available, but analytics will continue normally'));
    }
  }

  /**
   * Setup integration between Console Bridge and main WebSocket
   */
  setupConsoleBridgeIntegration() {
    if (!this.consoleBridge || !this.webSocketServer) return;
    
    // Forward console interactions from bridge to main WebSocket
    this.consoleBridge.on('console_interaction', (interactionData) => {
      console.log(chalk.blue('📡 Forwarding console interaction to web interface'));
      
      // Broadcast to main WebSocket clients
      this.webSocketServer.broadcast({
        type: 'console_interaction',
        data: interactionData

View on GitHub (pinned to a0851ed10c)

Solutions

  1. Verify no other CLI/analytics instance holds the Console Bridge port (lsof -i)
  2. Start the Console Bridge process/dependency the integration expects
  3. Ignore if you don't need console interactions — analytics work regardless
  4. Update the CLI so the bridge protocol version matches
Defensive patterns

Strategy: try-catch

Validate before calling

// Probe bridge availability before analytics init
const bridgeOk = await probeConsoleBridge(port).catch(() => false);
if (!bridgeOk) console.warn('console interactions disabled');

Try / catch

try { this.setupConsoleBridgeIntegration(); }
catch (error) {
  console.warn('Console Bridge initialization failed:', error.message);
  // analytics continue; do not rethrow
}

Prevention

When it happens

Trigger: Console Bridge server not running, port already in use, missing config, or an exception thrown inside setupConsoleBridgeIntegration() (bad path, WebSocket failure).

Common situations: Starting the analytics dashboard without the Console Bridge companion process; port conflict with another instance; version drift between CLI and Console Bridge protocol.

Related errors


AI-assisted analysis of davila7/claude-code-templates@a0851ed10c (2026-08-28). Data as JSON: /api/errors/451ca913482d7710. Report an issue: GitHub.