TimeoutError: Navigation Timeout Exceeded: 30000ms exceeded
See original GitHub issueI found out that busy build machines running conversion experience puppeteer error:
TimeoutError: Navigation Timeout Exceeded: 30000ms exceeded
It originates from this line:
await this[_page].goto(fileUrl(tempFile.path));
As this is this uses browser just for rendering, not networking, it seems appropriate fix would be to configure page timeouts (as only page objects allow that):
if (!this[_browser]) {
this[_browser] = await puppeteer.launch(this[_options].puppeteer);
this[_page] = await this[_browser].newPage();
}
->
if (!this[_browser]) {
this[_browser] = await puppeteer.launch(this[_options].puppeteer);
this[_page] = await this[_browser].newPage();
this[_page].setDefaultTimeout(0); // Disabled timeout
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How to solve Puppeteer TimeoutError: Navigation timeout of ...
How to solve Puppeteer TimeoutError: Navigation timeout of 30000 ms exceeded ... (specifically the TimeoutError) after a page takes more than 30000ms (30 ......
Read more >Webscraping TimeoutError: Navigation timeout of 30000 ms ...
the timeout is exceeded during navigation. the remote server does not respond or is unreachable. the main resource failed to load. By default, ......
Read more >Navigation timeout of 30000 ms exceeded with Puppeteer ...
Works fine in emulator, as soon as I deploy to the cloud it gives "Navigation timeout of 30000 ms exceeded" error 90% of...
Read more >Fix: navigation timeout of 30000 ms exceeded in puppeteer?
In this video, I am going to show you how we can fix navigation timeout of 30000 ms exceeded in puppeteer.You will generally...
Read more >Dealing with timeouts in Puppeteer 🐢️
The Problem: "TimeoutError: Navigation Timeout Exceeded: 30000ms exceeded" # · Solution 1: Set or disable the timeout for a navigation/request #.
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
Ah sorry, I didn’t see the distinction between browser instance startup timeout and page navigation timeout. You’re right that this isn’t currently supported via puppeteer options, however, I’m still a bit curious as to why it should ever timeout after 30 seconds. Are the SVGs you’re rendering containing remotely hosted resources (e.g. images, fonts)?
If we were to disable the page navigation timeout, I think it would need to be done on a opt-in basis as I feel like this is implementation detail for puppeteer itself which I’d like to keep out as much as possible.
What I might consider is splitting the existing puppeteer options to be passed down as follows:
puppeteerLaunch
- options passed topuppeteer.launch
(i.e. https://github.com/puppeteer/puppeteer/blob/v1.10.0/docs/api.md#puppeteerlaunchoptions)puppeteerPageGoto
- options passed topage.goto
(i.e. https://github.com/puppeteer/puppeteer/blob/v1.10.0/docs/api.md#pagegotourl-options)puppeteer
- an alias forpuppeteerLaunch
for backwards compatibilityThis should be able to offer greater control for those like yourself that need it and then you could simply do the following:
For now I worked around this by catching exception and retrying few times before failing.