Page timeout due to script loading error/timeout
See original GitHub issue- Puppeteer version: 1.13 and 1.15
- Platform / OS version: Ubuntu 18.04
- URLs (if applicable): https://www.echt-susteren.nl/ and https://www.noordwijk.nl/
- Node.js version: v8.16.0
I use Puppeteer to check 360 sites for cookies. 358 of them work with a 9s timeout. 2 of them don’t work at all, not even with a 90s timeout.
Script:
const browser = await puppeteer.launch(/*{executablePath: '/usr/bin/chromium-browser'}*/);
const page = await browser.newPage();
try {
await page.goto(url, {timeout: 90000});
}
catch (ex) {
console.log(ex.constructor.name + ': ' + ex.message);
process.exit();
}
Only for those 2 URLs, it keeps crashing with TimeoutError: Navigation Timeout Exceeded: 90000ms exceeded
.
A separately installed chromium (via executablePath
) (73.0.3683.86
) doesn’t change anything.
I can’t see why it times out. Only that it times out. Can’t it connect? Is it loading too much? They work fine in my real (Windows) Chrome browser. The other 358 sites work fine too. Is there a more debug mode? A Network panel?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:33 (2 by maintainers)
Top Results From Across the Web
Script timeout - WebDriver - MDN Web Docs
The script timeout error is a WebDriver error that occurs when a script the user has provided did not complete before the session's...
Read more >Can a timeout be initiated for script loading when the server is ...
I'm requesting a file via a script tag that times out after 21 seconds at which point the page tries to build without...
Read more >11 Ways to Fix the ERR_CONNECTION_TIMED_OUT Error
Solution 9: Check the Maximum Execution Time ... A PHP script's maximum execution time is the maximum amount of time it can execute...
Read more >Most common causes for Page load Timeout issues ... - Support
1. Webpage with Basic Authentication · 2. Local Web Application · 3. Page not available, Page not found or Server timed out.
Read more >Page Load Timed-out Amount - New Relic Explorers Hub
I've been getting this timeout error lately on one of my Synthetics scripts. TimeoutError: Page load timed-out (unable to finish all network ...
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
In my case the
goto
timeout happens because of a forever-loading blocking resource (js or css). That’ll never trigger the page’sload
ordomcontentloaded
. A bug in Puppeteer IMO, but whatever.My fix (FINALLY!) is to do what Lighthouse does in its
Driver
: aPromise.race()
for a custom ‘timeout’-ish. The shorter version I used:The
sleep()
andpage.goto()
race. If it’s the timeout, the result is clearly a fail (LOAD_FAIL). Otherwise it’s whateverpage.goto()
returns. Like this, it doesn’t throw aTimeoutException
, and the page is still queryable.That was my issue. I don’t know all your semi-related issues.
Is the normal behavior of puppeteer not supposed to be the same as a “normal” browser ? In this case I think this issue should be reopen.