[Bug]: page.goto never returns for a load started as a newer service worker takes over (Chromium)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 12/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- javascript, typescript
- 領域
- testing-qa
調査の方向性
The hang sits in the Chromium driver's handling of Page.navigate when a service worker takes over mid-load, so start from the navigation code in the Chromium backend of the playwright repository and the protocol log in the reproduction repo (protocol-log-hung-run.txt). Run repro.mjs repeatedly to reproduce it, then compare against the direct DevTools protocol scenario. Done would mean page.goto resolves in the takeover case without changing the reproduction's expected timings.
索引モデルが issue の本文から書いたものです。
説明
Version
1.65.1 (latest release); also 1.66.0-alpha-2026-11-20 (next)
Steps to reproduce
- Clone https://github.com/MorrisonWill/playwright-sw-takeover-goto-hang
npm installnpx playwright install chromiumfor i in 1 2 3 4 5 6 7 8 9 10; do node repro.mjs; done- Each run prints
loaded /after in N ms(exit 0) orthe load did not finish: TimeoutError: page.goto: Timeout 15000ms exceeded.(exit 1). About half or more of the runs hang.
repro.mjs is one file with no dependency besides playwright-core. It serves a tiny site whose service worker answers page loads from navigation preload, else fetch, else an offline page. Tab one starts a load the server holds, so worker 1 stays busy. The server then serves worker 2, which installs and waits (it called skipWaiting). When the held load is answered, worker 2 takes over and worker 1 is stopped. A page.goto started in tab two at that moment is the one that hangs.
Expected behavior
page.goto(origin + "/after") resolves once the page loads (worker 2 answers it, or the browser falls back to the network), as it does every time when the same steps are driven over the DevTools protocol without Playwright.
Actual behavior
page.goto never returns. Playwright's Page.navigate gets no answer until the browser is closed (then net::ERR_ABORTED), the frame never commits, and the Page object stops working: page.evaluate fails with "Target page, context or browser has been closed", although no close event is emitted and the page is no longer in context.pages().
The navigation preload response for that load arrives (200, loading finished) while it hangs. Chromium reports the old worker's target as crashed (Inspector.targetCrashed), which it does on every takeover when a client is attached, hang or not.
How often, same scenario:
| Driver | The load hangs |
|---|---|
repro.mjs, Playwright 1.65.1, Ubuntu 24.04, Node 24 |
5 of 10 |
repro.mjs, Playwright 1.65.1, a second machine (Arch-based Linux 7.2, Node 26) |
7 of 10 |
Playwright 1.65.1, page.goto, in a fuller probe |
6 to 7 of 10, and 16 of 20 |
Playwright 1.66.0-alpha-2026-11-20, page.goto |
5 of 10 |
Playwright 1.65.1 with PLAYWRIGHT_DISABLE_SERVICE_WORKER_NETWORK=1 |
3 of 10 |
The DevTools protocol directly (own WebSocket, Target.createTarget, Page.navigate, Page.loadEventFired) |
0 of 12 |
Directly, auto-attached to all targets (Target.setAutoAttach, flatten) |
0 of 15 |
Directly, auto-attached with waitForDebuggerOnStart: true, each target resumed with Runtime.runIfWaitingForDebugger |
0 of 15 |
| As above, and page-level service worker sessions detached at once | 0 of 15 |
As above, and Network.enable on pages and workers |
0 of 15 |
Under Playwright, the same load started other ways does not hang (20 runs each, in ways-to-load.txt): page.evaluate(() => location.href = url) then page.waitForURL(url, { waitUntil: "load" }): 0 of 20; a context.newCDPSession(page) doing Page.navigate and waiting for Page.loadEventFired: 0 of 20. A locator.click() on a link that navigates across the same takeover hung once in 65 rounds ("waiting for scheduled navigations to finish").
From DEBUG=pw:protocol of a run that hangs (the whole log is protocol-log-hung-run.txt in the repository; session 612083F7... is the second tab, 7041D190... is worker 1):
20:28:00.958Z SEND {"id":79,"method":"Page.navigate","params":{"url":"http://127.0.0.1:40365/after","frameId":"8EF0890A...","referrerPolicy":"unsafeUrl"},"sessionId":"612083F7..."}
20:28:00.959Z RECV Page.frameStartedNavigating {"frameId":"8EF0890A...","url":"http://127.0.0.1:40365/after","navigationType":"differentDocument"}
20:28:00.960Z RECV Network.requestWillBeSent (the navigation, loader 99073655...)
20:28:00.965Z RECV Network.requestWillBeSent {"requestId":"preload-9", ... "/after"} (navigation preload, on worker 1's session)
20:28:00.965Z RECV Network.responseReceived {"requestId":"preload-9", "status":200}
20:28:00.965Z RECV Network.loadingFinished {"requestId":"preload-9"}
20:28:00.967Z RECV {"method":"Inspector.targetCrashed","params":{},"sessionId":"7041D190..."} (worker 1)
20:28:00.967Z RECV Target.detachedFromTarget {"sessionId":"7041D190...","targetId":"571988D4..."}
... service worker targets attached and detached (worker 2) ...
(nothing for frame 8EF0890A... after this: no frameNavigated, no commit, no load)
20:28:15.968Z SEND Runtime.evaluate ... (the test's own check, which then fails: target closed)
20:29:20.202Z RECV {"id":79,"result":{"frameId":"8EF0890A...","loaderId":"99073655...","errorText":"net::ERR_ABORTED"}} (only when the browser is closed)
Additional context
Found while making an installed-app (PWA) end-to-end test reliable: it failed in about 3 of 50 CI runs at a page.goto started while a deploy brought in a new worker. The site's own worker is not the cause, since the direct protocol runs above load every time. I did not find an existing issue for this; the nearest are WebKit and Firefox navigation hangs.
I do not intend to work on a fix myself. The investigation and this report were prepared with the help of an AI coding agent; the reproduction was run on two machines and the numbers above are from those runs.
Environment
System:
OS: Linux 6.8 Ubuntu 24.04 (x64); also Linux 7.2, Arch-based (x64)
Binaries:
Node: 24.22.2; also 26.12.0
npm: 11.20.0
npmPackages:
playwright-core: 1.65.1
Browser:
Chromium 1255 from Playwright's download (Chrome for Testing 159.0.8154.6), headless
- 主要言語
- TypeScript
- スター
- 100k
- フォーク
- 6.9k
- 平均マージ
- 16時間 8分
- マージ済み PR(30日)
- 281
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/playwright のほかの issue
-
[MCP]: page snapshots in .playwright-mcp/ are not git-ignored (.playwright-cli/ is, since #42318)オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
microsoft/playwright#44289 ·
メンテナーはふだん 1 日以内に返信
-
agent-triage-done
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
microsoft/playwright#44264 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 12/100
microsoft/playwright#44290 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 22/100
microsoft/playwright#44288 ·
メンテナーはふだん 1 日以内に返信
-
[MCP] browser_tabs list/select indices diverge across HTTP sessions with --shared-browser-contextオープン
難易度 4/5 3〜5日 初心者へのやさしさ 22/100
microsoft/playwright#44279 ·
メンテナーはふだん 1 日以内に返信
microsoft/playwright の issue をすべて見る
似ている issue
-
good first issue
難易度 2/5 半日 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
blamechris/chroxy#9272 ·
メンテナーはふだん 1 日以内に返信
-
no-repo-link tool-submission
難易度 1/5 1時間未満 初心者へのやさしさ 66/100
BraveOPotato/NoSignups#2458 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
drmrd/vernacular#1061 ·
メンテナーはふだん 1 日以内に返信
-
[Bug] PUT /profiles/{id} silently drops design_prompt — designed voice profiles cannot be editedオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100