{"record":{"id":"451ca913482d7710","repo":"davila7/claude-code-templates","slug":"console-bridge-initialization-failed","errorCode":null,"errorMessage":"⚠️ Console Bridge initialization failed:","messagePattern":"⚠️ Console Bridge initialization failed:","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cli-tool/src/analytics.js","lineNumber":1559,"sourceCode":"        port: 3334,\n        debug: false // Set to true for detailed debugging\n      });\n      \n      // Initialize the bridge\n      const success = await this.consoleBridge.initialize();\n      \n      if (success) {\n        console.log(chalk.green('✅ Console Bridge initialized on port 3334'));\n        console.log(chalk.cyan('🔌 Web interface can connect to ws://localhost:3334 for console interactions'));\n        \n        // Bridge console interactions to main WebSocket\n        this.setupConsoleBridgeIntegration();\n      } else {\n        console.warn(chalk.yellow('⚠️ Console Bridge failed to initialize - console interactions disabled'));\n      }\n      \n    } catch (error) {\n      console.warn(chalk.yellow('⚠️ Console Bridge initialization failed:'), error.message);\n      console.log(chalk.gray('Console interactions will not be available, but analytics will continue normally'));\n    }\n  }\n\n  /**\n   * Setup integration between Console Bridge and main WebSocket\n   */\n  setupConsoleBridgeIntegration() {\n    if (!this.consoleBridge || !this.webSocketServer) return;\n    \n    // Forward console interactions from bridge to main WebSocket\n    this.consoleBridge.on('console_interaction', (interactionData) => {\n      console.log(chalk.blue('📡 Forwarding console interaction to web interface'));\n      \n      // Broadcast to main WebSocket clients\n      this.webSocketServer.broadcast({\n        type: 'console_interaction',\n        data: interactionData","sourceCodeStart":1541,"sourceCodeEnd":1577,"githubUrl":"https://github.com/davila7/claude-code-templates/blob/a0851ed10c7c60463dac8cfaaca124cf32d5804d/cli-tool/src/analytics.js#L1541-L1577","documentation":"The Console Bridge integration inside ClaudeAnalytics failed during initialization (catch around setupConsoleBridgeIntegration and related setup). Analytics continue normally; only console interactions are disabled.","triggerScenarios":"Console Bridge server not running, port already in use, missing config, or an exception thrown inside setupConsoleBridgeIntegration() (bad path, WebSocket failure).","commonSituations":"Starting the analytics dashboard without the Console Bridge companion process; port conflict with another instance; version drift between CLI and Console Bridge protocol.","solutions":["Verify no other CLI/analytics instance holds the Console Bridge port (lsof -i)","Start the Console Bridge process/dependency the integration expects","Ignore if you don't need console interactions — analytics work regardless","Update the CLI so the bridge protocol version matches"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Probe bridge availability before analytics init\nconst bridgeOk = await probeConsoleBridge(port).catch(() => false);\nif (!bridgeOk) console.warn('console interactions disabled');","typeGuard":null,"tryCatchPattern":"try { this.setupConsoleBridgeIntegration(); }\ncatch (error) {\n  console.warn('Console Bridge initialization failed:', error.message);\n  // analytics continue; do not rethrow\n}","preventionTips":["Treat Console Bridge as optional; never let it block analytics startup","Check port availability before starting a second instance","Version-lock the CLI and bridge together"],"tags":["console-bridge","websocket","initialization","graceful-degradation"],"backgroundTag":"service-initialization-failed","analyzedSha":"a0851ed10c7c60463dac8cfaaca124cf32d5804d","analyzedAt":"2026-08-28T14:11:56.058Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}