Unstable breakpoint verification in WebStorm JavaScript Debug with custom Chrome profiles
0 reputation · 11 Mar 2022, 06:23 UTC
0 reputation · 11 Mar 2022, 06:23 UTC
WebStorm's JavaScript Debug run configuration is documented to launch Chrome with a dedicated debugging profile and a remote-debugging port, yet the exact default port, the fallback behavior when that port is occupied, and the naming of the custom profile directory are not exposed as a single persistent user setting. Because these details vary by version and platform, teams cannot reliably predict which port or profile path an active session will use, which complicates environments that require parallel debug sessions or machine-wide standardization.
The supported guidance is to close any running Chrome instance before starting a debug session, but the same launch flow also underlies Live Edit and server-side attach scenarios. When the IDE silently selects an alternative port or creates a differently named profile, downstream tooling and team conventions may break without any visible error in the IDE.
What is the documented default debug port for WebStorm's Chrome launch flow, and does the IDE fall back to a free port when that default is occupied? What naming convention does WebStorm use for the custom Chrome profile directory, and is there a supported way to override or persist that name? Should these behaviors be treated as stable across WebStorm versions, or are they internal implementation details subject to change?
31775 reputation · 11 Mar 2022, 09:08 UTC
JetBrains does not document one persistent setting that fixes both the remote-debugging port and the Chrome user-data directory used by the built-in JavaScript Debug launch. Both values are chosen at launch time, so they are best treated as internal implementation details rather than a stable contract. The port most commonly associated with this flow is 9222, Chrome's conventional remote-debugging port, but treat that as likely rather than confirmed. Current builds generally fall back to another free loopback port when the preferred one is occupied, which is why parallel sessions can land on different ports with no visible message. The profile directory is generated under the operating system's temporary area with a name that is not a documented constant. The supported way to pin either value is a custom browser entry that passes explicit command-line arguments.
| Detail | Status |
|---|---|
| Close running Chrome before starting a debug session | Documented guidance |
| Browsers and Preview UI accepts custom browser entries with arguments | Documented, supported override |
Fixed default debug port of 9222 | Likely, not a documented constant |
| Silent fallback to a free loopback port when the default is taken | Likely in current builds; older builds were more likely to fail or attach to an existing Chrome |
| Generated profile directory name under the temp area | Internal; do not hardcode it in tooling |
| Older extension-based flow connecting back to the IDE server port | Historical; version-dependent |
The same launch flow underlies Live Edit and server-side attach scenarios, so the constraint propagates to them: two Chrome processes cannot share one user-data directory, and a second launch with the same path hands off to the already-running instance.
In Settings | Tools | Browsers and Preview, define a custom browser entry and supply the arguments yourself. This is the reliable way to make the port and profile predictable for a team or for parallel sessions.
chrome --remote-debugging-port=9222 --user-data-dir=<your-profile-path>
Give each parallel session its own profile path. Sharing one path across sessions does not create two debug targets; it reuses the first instance.
ps on macOS/Linux) and note the --remote-debugging-port and --user-data-dir values in use.Port selection, profile naming, and whether the older IDE Support extension is required have all changed across WebStorm releases. Verify against the exact build in use rather than assuming machine-wide consistency. Corporate endpoint agents, antivirus, or firewall policy can also block or rewrite loopback debugging ports, producing symptoms that look like IDE instability but are environmental.
One diagnostic detail changes the recommendation: the launch command line from Help | Show Log, or the Chrome process command line. If it shows the IDE choosing the port, the fix is a pinned custom browser entry; if it shows a pinned port that still fails intermittently, the cause is more likely environment or port contention, and configuration changes will not help. Because these behaviors are version-sensitive, treat this draft as a conservative starting point and confirm against your installed build before standardizing on it.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.