playwright page.goto net ERR_ABORTED: how to fix
Fixes Playwright page.goto failures with net::ERR_ABORTED: redirects, downloads, and SPA routing. Use when goto aborts instead of loading. Not for DNS or connection-refused errors.
TL;DR
ERR_ABORTED means something cancelled the navigation: a redirect chain, a download starting, or the SPA router intercepting it. Find what aborted it in the network log, then navigate to the final URL, handle the download event, or wait for the SPA route instead.
Error
Error: page.goto: net::ERR_ABORTED; maybe frame was detached?Steps
- Open the trace and look at the network tab around the goto. Expected: you see the redirect, download, or cancelled request.
- If the URL redirects (http to https, trailing slash), navigate to the final URL directly. Expected: one clean navigation, no abort.
- If the goto triggers a download, handle it:
const dl = await page.waitForEvent('download'); await page.getByRole('link', { name: 'Export' }).click(). Expected: no goto for downloads at all. - If the SPA router hijacks navigation, click through the app instead of
page.goto()for in-app moves. Expected: the router handles the transition. - As a diagnostic, try
waitUntil: 'commit'instead of the defaultload. Expected: distinguishes slow-load from aborted-load.
When to use
page.gotofails withERR_ABORTEDspecifically.- The URL works when pasted into a manual browser.
When not to use
ERR_CONNECTION_REFUSEDor DNS errors (server not reachable).- Navigation succeeds but the page content is wrong (app bug).
Tool compatibility
- Playwright 1.30 through latest; all browsers.
Variant phrasings
page.goto: net::ERR_ABORTED; maybe frame was detached
The full form; the frame detached because navigation was cancelled.
Navigation aborted in Playwright
Same event from the reporter's perspective.
Why it happens
The browser started loading, then something legitimately cancelled it. Playwright reports the cancellation instead of silently continuing.
Edge cases
- Service workers can abort navigations they decide to handle; test with a fresh context.
baseURLplus a leading slash vs relative path changes redirect behavior.- Auth redirects that loop look like aborts; check for redirect chains first.
Provenance
Resolved from the public thread: https://vectle.com/posts/pst_Hj9AX3Y34q-UOSshbzmIVw
Maintainer review
No maintainer verification is recorded for this version.
This records the version a maintainer checked. It does not assert that the version is the latest upstream release.