microsoft / microsoft/vscode-js-debug
Page becomes unresponsive after Disconnect → Re-attach in attach mode (CDP state not fully released)
@connor4312 is already working on this.
Since Apr 15, 2026.
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 373
- Avg merge
- 1d 9m
- Merged PRs (30d)
- 6
Description
Two issues when using attach mode to connect to an already-running Edge browser with
--remote-debugging-port=9222:
Bug 1: Page becomes unresponsive after re-attach (Disconnect → Re-attach)
- First attach to a browser tab works correctly — page is fully interactive.
- Click Disconnect (not Terminate — browser stays open, tab remains).
- Attach again to the same tab (same URL, same browser, same port).
- The page becomes completely unresponsive — no clicks, no scrolling, no interaction
at all. The page appears frozen/locked. - Only restarting VS Code restores the ability to attach normally, but the cycle
repeats: 1st attach OK → disconnect → 2nd attach broken → must restart VS Code again.
This suggests that js-debug does not fully release CDP domain state (e.g. Debugger,
Overlay, Input) on disconnect, leaving the page in a "still-being-debugged" state that
blocks user interaction on the next attach.
Bug 2: Page becomes sluggish after several hot reloads while attached
While attached, after a few HMR (Hot Module Replacement) updates, the page becomes
noticeably laggy. This worsens progressively and suggests a memory leak — possibly CDP
sessions or event listeners accumulating across hot reloads without being cleaned up.
To Reproduce
Bug 1:
- Launch Edge with --remote-debugging-port=9222
- Open a web app (e.g. https://example.com) in a tab
- In VS Code, start debugging with the attach config below
- Verify the page is interactive (click links, scroll, etc.) — works fine
- Click the Disconnect button in the debug toolbar (not Terminate)
- Start debugging again with the same config (attaching to the same tab)
- Try to interact with the page — page is completely frozen/unresponsive
- Only restarting VS Code allows a successful attach again
Bug 2:
- Attach to a running web app (same config)
- Make code changes to trigger HMR hot reloads 3-5 times
- Observe increasing page lag/stuttering with each reload
Log File
(Will attach trace log if requested)
VS Code Version: 1.115.0
Environment:
- OS: macOS (Darwin)
- Browser: Microsoft Edge (Chromium)
- Debug port: 9222 (--remote-debugging-port=9222)
- Debug type: msedge / attach
Launch config:
{
"type": "msedge",
"request": "attach",
"name": "my-app",
"urlFilter": "https://example.com/*",
"webRoot": "${workspaceFolder}",
"port": 9222,
"timeout": 1000,
"sourceMaps": true,
"skipFiles": ["node_modules/**", "<node_internals>/**"]
}
Additional context
- This is not related to any extensions — reproduced with all other extensions
disabled. - Bug 1 is 100% reproducible: first attach always works, second attach (after
disconnect) always fails. - The issue is specific to Disconnect (page stays open). Using Terminate (which closes
the page) does not exhibit this problem since the tab is destroyed. - Suspect that on disconnect, js-debug leaves CDP domains like Debugger, Overlay, or
Runtime in an enabled state on the target, which then blocks page interaction when a
new debug session attaches.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.