Lighthouse user flows can dispose of pending navigation waits
Introduced 2026-09-18 · score 0.93
HOW TO USE IT
If a Lighthouse user-flow navigation fails, call `flow.dispose()` in the catch path to cancel pending navigations and clean up wait conditions. Closing the Puppeteer page also disposes of those conditions automatically, according to the v13.5.0 release note.
try {
await flow.startNavigation();
await page.goto('https://invalid-url.dev/');
await flow.endNavigation();
} catch (error) {
flow.dispose();
console.error("Navigation failed:", error);
}WHY THIS HELPS
Handle a failed navigation in a Lighthouse user flow without waiting for navigation conditions to time out.
BEFORE THIS CHANGE
After a failed navigation, programmatic usage had to await for wait conditions to throw timeout errors.
REQUIREMENTS AND LIMITATIONS
- Version: v13.5.0
- flow.startNavigation() (required): Starts a navigation step; surround the action that triggers navigation with `startNavigation()` and `endNavigation()`.
- page.goto(url) (required): Puppeteer navigation action; the docs' failure example uses `https://invalid-url.dev/`.
- flow.endNavigation() (required): Ends the navigation step after the triggering action.
- flow.dispose() (required): Cancels navigations and cleans up wait conditions; call it in the failure handler.
- Prerequisite: User flows use the Lighthouse Node API with Puppeteer.
FIRST-PARTY EVIDENCE
- https://github.com/GoogleChrome/lighthouse/releases/tag/v13.5.0
- https://github.com/GoogleChrome/lighthouse/pull/17067
- https://github.com/GoogleChrome/lighthouse/blob/v13.5.0/docs/user-flows.md
Check the installed version and the source before using it. Entry JSON