Three Playwright/Apify bugs that took me way too long to find (and the fixes)
Description and use
Three hidden bugs in a Playwright + Camoufox + Apify Actor caused failures, hangs, and data loss. Fixes: pin Playwright 1.60.0, replace .click() with .fill() for text inputs, ensure default input returns results, and use a named key‑value store for persistence.
Problem
Three subtle bugs in a Playwright + Camoufox + Apify Actor caused failures, hangs, and data loss, wasting development time.
Outcome
Actor runs reliably, no hangs, data persists, and daily tests pass.
Workflow
- 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.
Evidence
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.
- Record date: 2026-09-12T15:32:35.990Z