Browser channel override still requires the bundled Playwright Chromium

Đang mở
#2,606 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
72/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
playwright, typescript
Lĩnh vực
backend, testing

Hướng nghiên cứu

Start with packages/runtime-playground/src/browser-capture-session.ts, tracing how launchChromiumBrowser() and playwrightBrowserReadiness() handle WP_CODEBOX_BROWSER_CHANNEL. Check the browser provenance and metadata paths named by the issue as well. Confirm channel mode launches and reports readiness without bundled Chromium, while no-channel mode keeps requiring it with the existing error.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Problem

launchChromiumBrowser (packages/runtime-playground/src/browser-capture-session.ts) first calls assertPlaywrightBrowserReady(), which throws unless Playwright's bundled Chromium is on disk. Only after that does it launch with channel: process.env.WP_CODEBOX_BROWSER_CHANNEL.

This makes the documented channel override unusable on its own. A host that wants the system Chrome (WP_CODEBOX_BROWSER_CHANNEL=chrome, which every GitHub-hosted Ubuntu runner already has) still has to download the pinned Chromium and its apt dependencies, only to never launch it. playwrightBrowserReadiness() (used by discovery) has the same blind spot and reports such a host as unavailable.

Evidence

On a GitHub Actions ubuntu-latest runner with WP_CODEBOX_BROWSER_CHANNEL=chrome and google-chrome on PATH, a wordpress.browser-probe step failed with:

Required Playwright Chromium 149.0.7827.55 (revision 1228) is unavailable. Install the browser owned by this WP Codebox package with: node ./node_modules/playwright/cli.js install chromium

Downstream, the browser install step (playwright install --with-deps chromium) costs 56 s on average and up to 258 s per run in a production deploy gate.

Expected

  • When WP_CODEBOX_BROWSER_CHANNEL is set, launch through that channel without requiring the bundled Chromium. If the channel's browser is missing, Playwright's own launch error is the one surfaced.
  • playwrightBrowserReadiness() reports a channel-configured host as ready, or checks the channel's browser instead of the bundled one, so discovery agrees with launch.
  • Browser provenance and metadata name the channel in use.
  • With no channel set, behaviour is unchanged: the bundled Chromium is still required, with the same error.

AI disclosure: Claude (Anthropic) in the Pi coding agent (Franklin), directed by @chubes4. AI traced the failure from a deploy gate run and wrote this issue.

Ngôn ngữ chính
TypeScript
Star
19
Fork
4
Merge trung bình
35 phút
Pull request đã merge (30 ngày)
11

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Automattic/wp-codebox

Tất cả issue của Automattic/wp-codebox

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.