You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Error] unhandlederror-potential listener LEAK detected, popular #319468
bugIssue identified by VS Code Team member as probable bugerror-telemetryVS Code - Issues generated by telemetryfreeze-slow-crash-leakVS Code crashing, performance, freeze and memory leak issuesinsiders-releasedPatch has been released in VS Code InsiderswebviewWebview issues
Error at a.create (out/vs/workbench/workbench.desktop.main.js:403:18439) at Awe._event (out/vs/workbench/workbench.desktop.main.js:405:2009) at new Ge (out/vs/workbench/workbench.desktop.main.js:405:31381) at hle.doReadFileStream (out/vs/workbench/workbench.desktop.main.js:4998:91435) at hle.readFileStream (out/vs/workbench/workbench.desktop.main.js:4998:91371) at async vzo (out/vs/workbench/workbench.desktop.main.js:5362:12707) at async Q5e.loadResource (out/vs/workbench/workbench.desktop.main.js:5362:27665)
Kyle Cutler (@kycutler), this is currently a top error bucket, it is signaling a leak from the browser/webviewElement.ts based on the callstack, can you take a look?
I can connect this telemetry bucket to a reproducible user-visible failure: a WebView renderer ServiceWorker thread enters a persistent approximately 100% CPU loop and the VS Code window becomes unresponsive.
Environment:
VS Code 1.128.0, commit fc3def6774c76082adf699d366f31a557ce5573f
macOS arm64, Electron 42.5.0, Chromium renderer 148.0.7778.271
Remote SSH 0.124.0
A third-party WebView extension running on one Linux Remote SSH authority
I reproduced this twice in independent VS Code processes. Each used fresh and separate --user-data-dir, --shared-data-dir, and --extensions-dir directories, one remote authority, and one WebView, so old Service Worker state and multiple restored windows were not involved.
In both runs:
The WebView requested exactly 653 unique remote resources in one second (625 JS and 28 CSS).
During that burst, the renderer logged potential listener LEAK detected, popular with the exact stack from this issue:
Five seconds later telemetry/UnhandledError reported listenerCount: 175, count: 6.
The WebView renderer stayed near 100% CPU. In the first run, CodeWindow: detected unresponsive appeared about 28 seconds after the resource burst, followed by UnresponsiveSampleError.
macOS process samples identified the direct hot thread as ServiceWorker thread: 3,807/3,823 samples in the first run and 2,291/2,295 in the second, in V8/Electron microtask/compiler paths (MicrotasksScope, CompilationDependencies, DependOnNoSlackTrackingChange).
Terminating only the WebView renderer immediately stopped the CPU load and removed the Service Worker target.
CDP target snapshots directly mapped the hot renderer to the extension WebView iframe and its version-5 vscode-webview Service Worker. The remote extension backend remained near idle.
This suggests that the listener leak can be more than a telemetry-only error under high-fan-out Remote SSH WebView loads: it correlates with an actual Service Worker spin and a frozen workbench window. This also looks related to the streamed WebView resource path introduced by #311844.
I retained sanitized renderer/main/telemetry logs, CDP target snapshots, process tables, and macOS samples if maintainers need a focused attachment. I have not proven that the transferable-stream branch specifically is the only failing branch.
Adding a local-only reproduction with a working/failing pair, since most linked reports involve Remote-SSH. This occurs in a plain local window with no remote of any kind, and with freshly reset caches.
Fedora Linux 44 (KDE Plasma), Wayland (--ozone-platform=wayland)
Trigger extension: openai.chatgpt 26.707.71524 (Codex), whose webview loads several hundred JS/CSS assets on startup
No Remote-SSH / tunnel; local extension host; extension host was NOT recreated in the failing run
Controlled variables
Before the failing run, with VS Code fully exited, I moved aside Service Worker, Code Cache, and GPUCache from ~/.config/Code. The failure reproduced on the very next launch with fresh caches, so accumulated Service Worker state is not required.
Failing launch
About 1.4 s after the extension's webview started loading its assets, the renderer logged:
[error] potential listener LEAK detected, popular: Error
at a.create (workbench.desktop.main.js:431:18435)
at kxe._event (workbench.desktop.main.js:433:2009)
at new Ge (workbench.desktop.main.js:433:31379)
at jle.doReadFileStream (workbench.desktop.main.js:5134:91433)
at jle.readFileStream (workbench.desktop.main.js:5134:91369)
at async MQo (workbench.desktop.main.js:5499:12707)
at async W8e.loadResource (workbench.desktop.main.js:5499:27945)
[error] potential listener LEAK detected, dominated: Error
(same stack)
The webview never finished executing its JS (the extension's own log shows its backend initialized, but the webview's React bootstrap never ran). The webview renderer process then sustained ~40% CPU and the GPU process ~42% indefinitely while displaying a static loading image.
Working launch, same machine, 6 minutes later, nothing changed
The SAME two listener-LEAK errors with the same doReadFileStream -> loadResource stack appeared, but the webview completed its bootstrap normally about 4 s after activation ("app routes mounted after 6262ms" in the extension log).
Why this may be useful
The leak telemetry fires in both successful and failed loads of the same webview, so the bucket is a marker of the many-small-assets load burst, not of the failure itself. The user-visible failure is that some subset of resource loads apparently never completes (or never reaches the service worker consumer), leaving the webview's module graph unresolved with no error surfaced.
Reproduces locally on Linux/Wayland with fresh caches and no remote authority, so neither Remote-SSH latency nor accumulated Service Worker registrations are necessary conditions.
Consistent with the streamed webview resource path introduced in Use proper streams for loading webview resources #311844 intermittently dropping/stalling a transfer under a burst of hundreds of concurrent loadResource calls.
One additional observation, which I cannot currently reproduce reliably:
On at least one occasion, after the Codex extension had initialized successfully and continued to work normally for some time, an additional Code Helper (Renderer) process appeared and sustained approximately 100%-200% CPU. I had not opened another VS Code window or launched another VS Code instance, and the visible Codex UI remained functional.
I did not capture enough evidence at the time to map that renderer to a specific window, WebView, or Service Worker. I therefore cannot yet confirm that it was owned by Codex or that it followed the same failure path discussed above. Please treat this as a preliminary observation rather than a confirmed reproduction.
bugIssue identified by VS Code Team member as probable bugerror-telemetryVS Code - Issues generated by telemetryfreeze-slow-crash-leakVS Code crashing, performance, freeze and memory leak issuesinsiders-releasedPatch has been released in VS Code InsiderswebviewWebview issues
Activity
bryanchen-d commentedon Jun 1, 2026
Kyle Cutler (@kycutler), this is currently a top error bucket, it is signaling a leak from the browser/webviewElement.ts based on the callstack, can you take a look?
kycutler commentedon Jun 4, 2026
This is for webviews, not browser -- cc Matt Bierner (@mjbvz)
FinalePrestissimo commentedon Jul 10, 2026
I can connect this telemetry bucket to a reproducible user-visible failure: a WebView renderer
ServiceWorker threadenters a persistent approximately 100% CPU loop and the VS Code window becomes unresponsive.Environment:
fc3def6774c76082adf699d366f31a557ce5573fI reproduced this twice in independent VS Code processes. Each used fresh and separate
--user-data-dir,--shared-data-dir, and--extensions-dirdirectories, one remote authority, and one WebView, so old Service Worker state and multiple restored windows were not involved.In both runs:
potential listener LEAK detected, popularwith the exact stack from this issue:telemetry/UnhandledErrorreportedlistenerCount: 175,count: 6.CodeWindow: detected unresponsiveappeared about 28 seconds after the resource burst, followed byUnresponsiveSampleError.ServiceWorker thread: 3,807/3,823 samples in the first run and 2,291/2,295 in the second, in V8/Electron microtask/compiler paths (MicrotasksScope,CompilationDependencies,DependOnNoSlackTrackingChange).CDP target snapshots directly mapped the hot renderer to the extension WebView iframe and its version-5
vscode-webviewService Worker. The remote extension backend remained near idle.This suggests that the listener leak can be more than a telemetry-only error under high-fan-out Remote SSH WebView loads: it correlates with an actual Service Worker spin and a frozen workbench window. This also looks related to the streamed WebView resource path introduced by #311844.
I retained sanitized renderer/main/telemetry logs, CDP target snapshots, process tables, and macOS samples if maintainers need a focused attachment. I have not proven that the transferable-stream branch specifically is the only failing branch.
zhang-wenchao commentedon Jul 13, 2026
This is related to the Codex extension not working; Hope this issue can be tracked.
ozpavel commentedon Jul 14, 2026
Adding a local-only reproduction with a working/failing pair, since most linked reports involve Remote-SSH. This occurs in a plain local window with no remote of any kind, and with freshly reset caches.
Environment
--ozone-platform=wayland)Controlled variables
Before the failing run, with VS Code fully exited, I moved aside
Service Worker,Code Cache, andGPUCachefrom~/.config/Code. The failure reproduced on the very next launch with fresh caches, so accumulated Service Worker state is not required.Failing launch
About 1.4 s after the extension's webview started loading its assets, the renderer logged:
The webview never finished executing its JS (the extension's own log shows its backend initialized, but the webview's React bootstrap never ran). The webview renderer process then sustained ~40% CPU and the GPU process ~42% indefinitely while displaying a static loading image.
Working launch, same machine, 6 minutes later, nothing changed
The SAME two listener-LEAK errors with the same
doReadFileStream -> loadResourcestack appeared, but the webview completed its bootstrap normally about 4 s after activation ("app routes mounted after 6262ms" in the extension log).Why this may be useful
loadResourcecalls.codex-webview-hang-logs-minimal-20260714.zip
FinalePrestissimo commentedon Jul 15, 2026
One additional observation, which I cannot currently reproduce reliably:
On at least one occasion, after the Codex extension had initialized successfully and continued to work normally for some time, an additional
Code Helper (Renderer)process appeared and sustained approximately 100%-200% CPU. I had not opened another VS Code window or launched another VS Code instance, and the visible Codex UI remained functional.I did not capture enough evidence at the time to map that renderer to a specific window, WebView, or Service Worker. I therefore cannot yet confirm that it was owned by Codex or that it followed the same failure path discussed above. Please treat this as a preliminary observation rather than a confirmed reproduction.
webview: fix resource loading cancellation listener leaks (#338306)
webview: fix resource loading cancellation listener leaks (microsoft#…