Lighthouse user flows can dispose of pending navigation waits
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);
}