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:

Possible workarounds

  • Downgrade to react-snap@1.10.0
  • Maintain branch of react-snap with puppeteer@0.13.0 as dependency. Do we also need branch of minimalcss with puppeteer@0.13.0?
  • Create branch with “tip of the tree” puppeteer version

Created those branches:

About this issue

  • Original URL
  • State: open
  • Created 6 years ago
  • Comments: 22 (3 by maintainers)

Commits related to this issue

Most upvoted comments

Been struggling with this for a long time. I’ve noticed something interesting: when you launch using headless: false and then open the network tab while Chrome is running, the page will suddenly load correctly.

Also been getting But there are no pending connections all the time. In our case Intercom is being loaded, maybe that’s why networkidle0 is never fired?

Anyway I’ve found a workaround: simply changing await page.goto(pageUrl, { waitUntil: "networkidle0" }); to await 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?

I get no indication of what has timed out: image

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-snap worked fine. Also, changing the networkidle0 to load does 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.0 to ~1.10.0.

For my scenario we build inside Docker, and our package.json file uses the following config:

    "reactSnap": {
        "puppeteerArgs": [
            "--no-sandbox",
            "--disable-setuid-sandbox"
        ],
        "concurrency": 1,
        "inlineCss": false,
        "skipThirdPartyRequests": false
    }

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": false everything works, but our analytics doesn’t. But "skipThirdPartyRequests": true we got a timeout error.

Turns out it was all down to this same issue!

In our case Intercom is being loaded, maybe that’s why networkidle0 is never fired?

@nickjanssen I guess you need skip intercom in prerndering stage with this check if (navigator.userAgent!='ReactSnap') { loadIntercom() }