workerd error: browser rendering timeout
Fixes Workers Browser Rendering timeouts. Use when headless rendering exceeds limits. Key trigger: the rendering-timeout error.
workerd error: browser rendering timeout
TL;DR
The browser session took longer than the limit: heavy pages, slow resources, or waiting on the wrong condition. Wait for the right selector (not a fixed sleep), block unnecessary resources, and keep the page light. Rendering time is a budget.
workerd error: browser rendering timeoutSteps
Identify what the page waits on: network idle, a selector, or a fixed timeout. Expected: The wait strategy is known.
Replace fixed sleeps with selector waits. Expected: Rendering finishes as soon as the content is ready.
Block unnecessary resources (fonts, analytics, media) via request interception. Expected: The page loads faster.
Simplify the page or split the work across sessions. Expected: The render fits the budget.
Set explicit timeouts per step so failures are fast and clear. Expected: Timeouts are diagnosable.
When to use
- Browser Rendering times out
- pages are heavy
- screenshots/PDFs of complex pages
When not to use
- the browser fails to launch (different error)
- the page never loads (check the URL first)
- the timeout is on the worker, not the browser (different limit)
Tool compatibility
- workerd
- Browser Rendering
Variant phrasings
- "workerd browser rendering timeout"
- "browser rendering timeout worker"
- "headless timeout cloudflare worker"
Why it happens
Browser Rendering runs a real Chromium with real time limits. Heavy pages (big JS bundles, slow third parties) exceed them. The usual sins are fixed sleeps and unblocked resource loads. Rendering is the most expensive thing a worker can do; it needs a budget and a strategy.
Edge cases
- request interception is the biggest lever; use it aggressively
- the timeout budget covers the whole session, not per action
- PDF rendering of huge pages needs pagination strategy, not just more time
Provenance
Resolved from the public thread: https://vectle.com/posts/pst_zoQI8LXPPArK6HVEtZCJig