Skip to content

Guide to Attaching an IntelliJ IDEA Remote Debugger to the Electron Main Process ​

The SyncETA desktop application operates on a multi-process architecture consisting of the Electron Main Process (Node.js / Playwright control) and the Renderer Process (Vue 3 UI). This document describes the standard procedure for attaching a remote debugger from IntelliJ IDEA to the Electron main process via the V8 Inspector WebSocket (ws://127.0.0.1:5858) and tracing breakpoints.


1. Launch in Debug Mode (dev:debug) ​

Run the dev:debug script defined in package.json to start the Electron main process with the --inspect=5858 flag.

Launching Debug Mode

ScriptInternal FlagDefault Debug Port
yarn dev:debugelectron --inspect=5858 .127.0.0.1:5858 (V8 Inspector WebSocket)

2. Connect to the V8 Inspector Remote Debugger Socket ​

Ctrl + Click (or Cmd + Click) the Debugger listening on ws://127.0.0.1:5858/... link printed in the terminal console to immediately attach IntelliJ's built-in JavaScript/Node.js debugger.

Opening Debugger


3. Set Breakpoints and Inspect Runtime State ​

When you set breakpoints in the main process TypeScript source code (such as IPC handlers or Playwright browser context controllers), execution pauses when an event is invoked, allowing you to inspect the Call Stack and local variable states in real time.

Breakpoint


4. Debugging Targets and Precautions by Process ​

ProcessExecution RuntimeDebugger Attachment MethodPrimary Debugging Targets
Main ProcessNode.js / Electron Mainws://127.0.0.1:5858 V8 Inspector socket connectionipcMain.handle, Playwright browser pool control, local file I/O
Preload ScriptIsolated Context BridgeChromium DevTools (Ctrl+Shift+I) Sources tabcontextBridge.exposeInMainWorld API binding verification
Renderer ProcessChromium / Vue 3Chromium DevTools or Vite HMR consoleVue 3 component state (Pinia), scenario canvas UI rendering

TIP

Pausing for an extended period at a main process breakpoint may cause IPC response timeouts in the renderer process. When debugging asynchronous IPC calls, it is recommended to temporarily relax timeout thresholds or use conditional breakpoints.