Repository navigation
Description
Version
playwright-core 1.63.0-alpha (bundled with @playwright/cli 0.1.18 and 0.1.19). Same symptom reported earlier on 1.60.0 in #41093.
Steps to reproduce
Reproduces with any Chromium/Edge started with a debugging port — no special page or proxy needed. The trigger is a page target that exists at connect time but no longer answers page-level CDP commands (e.g. an Edge sleeping tab or a hung renderer), so I suspend one renderer to make that state deterministic:
# 1. start a browser with remote debugging
msedge --headless=new --remote-debugging-port=9333 --user-data-dir=/tmp/repro about:blank &
# 2. suspend the renderer of ONE tab (Chromium: one renderer process per tab)
ps -eo pid,args | grep repro | grep "type=renderer" # pick one pid
kill -STOP <renderer_pid> # Windows: pssuspend <pid>
# 3. this call never returns (unpatched client)
node -e "const{chromium}=require('playwright');chromium.connectOverCDP('http://127.0.0.1:9333',{timeout:15000}).then(b=>console.log('ok'))"
# => Timeout 15000ms exceeded; call log stops at <ws connected>
# 4. resume that renderer
kill -CONT <renderer_pid>
# => connectOverCDP returns in ~30 msNote TargetInfo.pid is not usable to locate the victim (it reports 0 in headless mode / before the renderer spawns), hence the process table lookup.
Expected behavior
connectOverCDP should return a browser object. A page that cannot be initialized should be reported as-is or skipped; at worst connect should fail with a clear error. It should not hang indefinitely.
Actual behavior
connectOverCDP never resolves (or expires when an explicit timeout is passed). The call log ends at <ws connected>, while browser-level CDP commands still answer when sent manually, which makes it look like a protocol/handshake problem.
Additional context
Root cause. Connect auto-attaches to every existing target and then awaits CRBrowser._waitForAllPagesToBeInitialized(), i.e. Promise.all([..._crPages].map(p => p._page.waitForInitializedOrError())). For the frozen page, Page.enable, Page.getFrameTree, Log.enable, Runtime.enable and Runtime.runIfWaitingForDebugger are sent but never answered, so that promise never settles.
Diagnostic signature. Pairing sent/answered CDP ids on the browser session: page-level commands for the stuck target get no reply for 30 s+, while browser-level commands answer immediately.
One bad tab poisons the whole connect (3-tab browser, 4 renderer processes, 1 suspended):
| check | result |
|---|---|
Target.getTargets (browser-level) |
OK, 3 targets |
Runtime.evaluate on the suspended tab |
TIMEOUT |
Runtime.evaluate on the other two tabs |
"tabA|1+1=2", "tabB|1+1=2" |
connectOverCDP (unpatched) |
FAILED after 15015 ms |
connectOverCDP after kill -CONT |
CONNECTED in 31 ms |
Related, but different await. #41093 shows the identical symptom on Edge 148 (WS connects, then hangs) and was closed as NOT_PLANNED for lack of a reliable repro; that reporter mentioned tabs "stuck due to loading errors or had gone into sleep mode" and that reloading every tab fixed it. PR #41128 addressed a page stuck on its first navigation commit, which is not the await that hangs here. #41397 (prerender activation) is a different mechanism again.
Why it matters for attach. In the everyday case — attaching to a user's own browser with many tabs — a single sleeping/hung tab makes every subsequent playwright-cli attach fail with Daemon process exited with code 1, until the user manually reloads/closes that tab.
Local workaround (not proposed as the fix): after the auto-attach sweep, drop _crPages entries whose targetId is absent from Target.getTargets, and race the initialization wait with a timeout. Connect then succeeds at the cost of a fixed 10 s delay; a targeted "skip/flag unresponsive page targets" approach would be better.
Environment
System:
OS: Linux 7.0 openSUSE Tumbleweed 20260430
CPU: (20) x64 AMD Ryzen AI 9 H 365 w/ Radeon 880M
Memory: 13.23 GB / 27.02 GB
Binaries:
Node: 24.14.1 - /usr/bin/node
npm: 11.11.0 - /usr/bin/npm
npmPackages:
@playwright/cli: 0.1.18 (unpatched) / 0.1.19 (patched workaround tested)
playwright-core: 1.63.0-alpha (bundled)
Browsers:
Microsoft Edge 148.0.3967.54 launched with --remote-debugging-port=9333
Activity
github-actions commentedon Sep 15, 2026
Hi, I'm the Playwright bot and I took a first look at this.
Reproduced on tip-of-tree (npm
playwright@next,1.64.0-alpha-2026-09-15), Chrome 152.0.7977.82 headless on Linux. Your analysis holds up: one page target that stops answering page-level CDP is enough to fail the wholeconnectOverCDP, even though the browser session and every other tab keep answering. With a suspended renderer the call fails with the default 30s timeout (or whatever explicittimeoutyou pass), and the call log ends at<ws connected>exactly as you described.SIGCONTon that one renderer, and the same connect succeeds in 47 ms.The hang is where you say it is —
CRBrowser.connectawaits_waitForAllPagesToBeInitialized()(crBrowser.ts:97), which isPromise.alloverwaitForInitializedOrError()for every auto-attached page, so a target whose renderer never replies toPage.enable/Runtime.enableblocks all of them. That's a different await from the first-navigation-commit case fixed in #41128, so this isn't covered by it.Repro I used (no Edge sleeping tab needed)
What I ran
playwright@next=playwright-core1.64.0-alpha-2026-09-15(your1.63.0-alphais the same code path)--headless=new, Linux (openSUSE not available to me; used the repo's CI Linux image)SIGSTOPpedconnectOverCDPwithtimeout: 15000→ FAILED after 15016 msconnectOverCDPwith no explicit timeout → FAILED after 30009 ms (default timeout, so it doesn't hang forever — but it never connects)connectOverCDPafterSIGCONT→ CONNECTED in 47 ms/json/listandRuntime.evaluateon the other page target answered immediatelyChromium-only by construction —
_waitForAllPagesToBeInitializedis on the CDP connect path, so there's nothing to compare against in firefox/webkit.Triaged on Linux by the Playwright bot - agent run
Om-singhaI commentedon Sep 18, 2026
This looks like the same hang as #41093. That one and #41128 were closed because there was no reliable repro and only one report. This issue has both: freezing one renderer with
kill -STOPhangsconnectOverCDPevery time, and the bot reproduced it on tip of tree. The #41093 reporter also said some of their tabs had gone into sleep mode, which is this mechanism rather than a navigation that never committed.It's a different await from #41128, though. The frozen renderer never answers the CDP commands in
FrameSession._initialize, so racing against the initial empty page wouldn't help here.Would you take a fix that stops
connectOverCDPfrom waiting on a page that was already open and never finishes initializing? I can put it together with a test that freezes one target through a CDP proxy.ZhongYic00 commentedon Sep 20, 2026
Yes, please go ahead om singhal (@Om-singhaI), and thanks for linking it back to #41093.
The principle I'd pin: gate nothing, cancel nothing. Connect stops waiting on pre-existing pages, but their init keeps running and completes on its own when the sleeping tab wakes, no re-attach needed.
That gives three invariants worth stating in the PR:
<ws connected>with Microsoft Edge 148 on Windows #41093 was parked.context.pages()stays a complete snapshot. Unresponsive pages are listed immediately, with no new events or public state API; their commands just hit per-action timeouts. One small ask: make that timeout's call log hint at the likely cause (suspended or discarded target).pages(), and apply all of this per auto-attached target: a frozen OOPIF renderer hangs page init just like a frozen main frame.alexnayko commentedon Oct 22, 2026
Additional standalone-client evidence from October 22, 2026, after recovering one failed page still left whole-browser attach unavailable.
Environment:
@playwright/cli0.1.15, bundledplaywright-core1.62.0-alpha-2026-06-29What I verified:
Timeout 30000ms exceeded, call log ends at<ws connected>. This failure does not require the npm engine-version warning seen in the original launch.chromium.connectOverCDP(endpoint, {headers, timeout: 10000})also times out. No application wrapper is necessary.pagetargets and twoiframetargets.Page.enable,Page.getFrameTree,Log.enable,Page.setLifecycleEventsEnabled,Runtime.enable,Page.addScriptToEvaluateOnNewDocument,Network.enable,Emulation.setFocusEmulationEnabled,Emulation.setEmulatedMediaandRuntime.runIfWaitingForDebuggerunanswered. Each iframe session left the equivalent batch unanswered, without the focus-emulation command.about:blankpage answeredRuntime.evaluate(1+1)andPage.enablein 25 ms. Only this control page was then closed.Runtime.evaluateon one of the two blocking page targets also timed out after eight seconds. This target had answered earlier in the incident, so the browser state had changed during collection.The relevant distinction is that restoring a particular failed page is insufficient if other pre-existing page/iframe sessions still do not answer. Even a healthy replacement page and browser-level CDP do not establish that whole-browser attach works.
This matches the existing all-pages-initialization blocker described here. The underlying renderer crash/freeze cause is still unknown; I have not attributed it to Playwright itself. No shared browser restart, mass tab cleanup, renderer suspension or local client patch was performed. Site names, target URLs, authentication data and page contents are omitted.
Recovery checkpoint, October 22 (operator-reported)
The operator independently confirmed my stale-target finding: the page that timed out in raw CDP above still did not answer
Runtime.evaluate(1)within ten seconds, and the earlier replacement for the other service was no longer in the target list. Only that handed-off, hung page was closed withTarget.closeTarget, which returnedsuccess: true.Two replacement service pages now return live, complete DOM state through raw
Runtime.evaluate, according to the operator, and their exact target IDs were handed back to the active collector. I have not independently reprobed these new pages. The earlier 15:25 UTC handoff is superseded by this target-specific checkpoint.The other previously observed blocking page was intentionally left untouched. No unrelated target was closed or reloaded, and the shared browser was not restarted. Whole-browser Playwright attach has not been reverified, and neither global recovery nor a renderer-crash root cause is claimed. This is restoration of the specific raw-CDP continuation route, not verification of an attach fix.