react-snap: Navigation Timeout Exceeded
Starting from version 1.18.0 there should be more details about this error. If you see Navigation Timeout Exceeded... and on the next line:
Tracked URLs that have not finished… or For…
You know what times out, go ahead and fix it.
But there are no pending connections
If you see this message, please report it here. It would be nice if you have reproducible example. I suspect this is a bug in puppeteer. I need reproducible examples to report it to puppeteer tracker.
Thanks.
In react-snap@1.10.x this error looks like
🔥 /path Error: Protocol error (Runtime.callFunctionOn): Target closed.
Possibly related puppeteer bugs
I suspect that the bug which causes this issue is https://github.com/GoogleChrome/puppeteer/issues/1454, which was introduced after Puppeteer 0.13.0. That is why downgrading react-snap to 1.10.0 works, because in 1.11.0 Puppeteer dependency was bumped to 1.0.0
Other:
- https://github.com/GoogleChrome/puppeteer/issues/2591
- https://github.com/GoogleChrome/puppeteer/issues/2963
- https://github.com/GoogleChrome/puppeteer/issues/1908#issuecomment-390214976
Possible workarounds
- Downgrade to
react-snap@1.10.0 - Maintain branch of
react-snapwithpuppeteer@0.13.0as dependency. Do we also need branch ofminimalcsswithpuppeteer@0.13.0? - Create branch with “tip of the tree”
puppeteerversion
Created those branches:
About this issue
- Original URL
- State: open
- Created 6 years ago
- Comments: 22 (3 by maintainers)
Commits related to this issue
- DIV-3516 - changed codecept's waitUntil networkidle0 to load Suggested by https://github.com/stereobooster/react-snap/issues/240 To fix timeout issue — committed to hmcts/div-respondent-frontend by hosainnet 6 years ago
- Change crawl timeout condition Based on conversation at https://github.com/stereobooster/react-snap/issues/240#issuecomment-415674947 We have changed the timeout condition to wait untill the page has... — committed to arcadian-group/react-snap by sean-gilmore 5 years ago
- fix(stereobooster/react-snap#240): shim requestAnimationFrame — committed to mysterycommand/react-snap by mysterycommand 4 years ago
Been struggling with this for a long time. I’ve noticed something interesting: when you launch using
headless: falseand then open the network tab while Chrome is running, the page will suddenly load correctly.Also been getting
But there are no pending connectionsall the time. In our case Intercom is being loaded, maybe that’s whynetworkidle0is never fired?Anyway I’ve found a workaround: simply changing
await page.goto(pageUrl, { waitUntil: "networkidle0" });toawait page.goto(pageUrl, { waitUntil: "load" });works flawlessly for me.Reference: https://github.com/GoogleChrome/puppeteer/blob/v1.7.0/docs/api.md#pagegotourl-options
Encountered the problem described by @dHannasch, any updates?
I downgrade to 1.10.0 as many people suggest and it works. However, some css files are not imported properly. Any better solution beside downgrade to 1.10.0?
cc @lewisdonovan @cascornelissen @yantakus
I get no indication of what has timed out:
Can confirm that this is still an issue. I use firebase (firestore) to fetch data on the landing page and that seems to introduce the timeout issue. Before that component
react-snapworked fine. Also, changing thenetworkidle0toloaddoes work as well.To chime in on this, I’ve just managed to resolve an issue I was having by downgrading my the version of react-snap from
^1.23.0to~1.10.0.For my scenario we build inside Docker, and our package.json file uses the following config:
We need to skip the third party requests because these are analytics tools that don’t start up correctly if we prerender them. With
"skipThirdPartyRequests": falseeverything works, but our analytics doesn’t. But"skipThirdPartyRequests": truewe got a timeout error.Turns out it was all down to this same issue!
@nickjanssen I guess you need skip intercom in prerndering stage with this check
if (navigator.userAgent!='ReactSnap') { loadIntercom() }