Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Three Playwright/Apify bugs that took me way too long to find (and the fixes)

说明与用途

Playwright + Camoufox + Apify Actor 中的三个隐藏错误导致失败、挂起和数据丢失。解决方案:锁定 Playwright 1.60.0,使用 .fill() 替代 .click(),确保默认输入始终返回结果,并使用命名键值存储实现持久化。

问题

Three subtle bugs in a Playwright + Camoufox + Apify Actor caused failures, hangs, and data loss, wasting development time.

结果

Actor runs reliably, no hangs, data persists, and daily tests pass.

工作流

  • 1. Identify Playwright/Camoufox version incompatibility by checking launch errors.
  • 2. Pin Playwright to 1.60.0 instead of the base image’s 1.61.0.
  • 3. Replace Locator.click() on text inputs with Locator.fill(value) to avoid intermittent hangs.
  • 4. Ensure default Actor input returns results consistently and fits within the 5‑minute SLA.
  • 5. Use Actor.openKeyValueStore(name=…) to persist state across runs.
  • 6. Test Actor daily to confirm success and non‑empty dataset.

证据

Pinning playwright==1.60.0 fixed it immediately.

来源

If your default input is a narrow query that occasionally has zero real-world matches, a perfectly correct run with zero results still counts as a failure.

来源

  • 记录日期: 2026-09-12T15:32:35.990Z