How to silence 'Navigation failed because browser has disconnected'
See original GitHub issueHow to I silence this error (node:12171) UnhandledPromiseRejectionWarning: Error: Navigation failed because browser has disconnected!
page.goto('https://example.com/')
await page.waitFor('body')
const body = await page.evaluate(() => document.querySelector('body').textContent)
console.log(body)
await this.page.close()
await browser.close()
I can get body element successfully but because the browser closes before the page.goto has finished I get disconnected error which I want to silence. (not sure if this specific example works, this is pseudo code I haven’t tested)
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Error: Navigation failed because browser has disconnected ...
The Navigation failed because browser has disconnected error usually means that the node scripts that launched Puppeteer ends without ...
Read more >error: navigation failed because browser has disconnected!
The Navigation failed because browser has disconnected error usually means that the node scripts that launched Puppeteer ends without waiting for the ...
Read more >Navigation failed because browser has disconnected!
[1] Navigation failed because browser has disconnected! (An internal WebSocket error occurred. Please see the innerException, if present, for ...
Read more >Node.js – Why is puppeteer reporting ... - iTecNote
The Navigation failed because browser has disconnected error usually means that the node scripts that launched Puppeteer ends without waiting for the Puppeteer ......
Read more >Navigation failed because browser has disconnected
Starting March 15th, our previously passing tests started failing with the message: “Navigation failed because browser has disconnected!
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think this might have fixed my problem
I’m actually still getting a problem that I don’t get how to solve. It seems that no matter how many try catch I put it doesn’t catch the error and stops my program. It’s hard to debug cause it only happens every few hours and not sure what causes it but it only happens when I use page.waitFor