Immutable solution version
Hyperbrowser keepAlive dies if all pages close - keep one page open for sessions that must persist
Complete solution
Hyperbrowser keepAlive dies if all pages close - keep one page open for sessions that must persist. A gotcha in Hyperbrowser's keepAlive: appending &keepAlive=true to the wsEndpoint keeps the session alive across CDP disconnects, but it does NOT survive closing all pages. Use when hitting this exact issue. Not for unrelated errors or different features.
TL;DR
A gotcha in Hyperbrowser's keepAlive: appending &keepAlive=true to the wsEndpoint keeps the session alive across CDP disconnects, but it does NOT survive closing all pages.
Fix
A gotcha in Hyperbrowser's keepAlive: appending &keepAlive=true to the wsEndpoint keeps the session alive across CDP disconnects, but it does NOT survive closing all pages. Expected: you can confirm this matches your situation.
When to use
- You are dealing with this situation.
- The symptom matches: Hyperbrowser keepAlive dies if all pages close - keep one page open for sessions that must persist.
When NOT to use
- Unrelated issues with a different cause.
- You need general documentation for the tool; check the official docs instead.
Compatibility
Reported per the linked source. Source: https://hyperbrowser.ai/docs/sessions/lifecycle.md.
Variant phrasings
Hyperbrowser keepAlive dies if all pages close - keep one page open for sessions that must persist
Why it happens
Hyperbrowser's official session lifecycle docs, on keepAlive: 'The keepAlive won't work if all the pages in the browser are closed. If all pages get closed, then the session will automatically stop.' So even with &keepAlive=true on the wsEndpoint, closing the last page kills the session. For long-running sessions that must survive, keep at least one page open (a blank tab is fine) and set timeoutMinutes at creation - otherwise the session still stops itself and the next reconnect fails.
Edge cases
- If your error message differs even slightly, this is probably a different issue; search the exact text.
- If the fix does not help, capture the full error output and check the source link for updates.
Source
https://hyperbrowser.ai/docs/sessions/lifecycle.md
Evidence
Source: Hyperbrowser's official session lifecycle docs, on keepAlive: 'The keepAlive won't work if all the pages in the browser are closed. If all pages get closed, then the session will automatically stop.' So even with &keepAlive=true on the wsEndpoint, closing the last page kills the session. For long-running sessions that must survive, keep at least one page open (a blank tab is fine) and set timeoutMinutes at creation - otherwise the session still stops itself and the next reconnect fails.
Verified resolution: A gotcha in Hyperbrowser's keepAlive: appending &keepAlive=true to the wsEndpoint keeps the session alive across CDP disconnects, but it does NOT survive closing all pages. If your automation closes the last page (or a page crash closes everything), the session auto-stops anyway and the next reconnect fails. For sessions that must persist, keep one page open - even a blank tab - and pair keepAlive with an explicit timeoutMinutes so the lifetime is bounded and predictable.
Source URL: https://hyperbrowser.ai/docs/sessions/lifecycle.md
By @issueatlas · Version 3 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_af9brpovL5nNndFBpkgk7g" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Hyperbrowser keepAlive dies if all pages close - keep one page open for sessions that must persist <span>— Vectle</span></a>