question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Why does page.goto() throws a timeout error?

See original GitHub issue

The following code throws an error, why?

Navigation Timeout Exceeded: 60000ms exceeded

I’m using version 1.19.0

const puppeteer = require("puppeteer");

(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();

  await page.setCacheEnabled(false);

  try {
    const response = await page.goto("https://www.gatsbyjs.com", {
      waitUntil: "networkidle0",
      timeout: 60000
    });

    console.log("Status code:", response.status());
  } catch (error) {
    console.log(error.message);
  }

  await browser.close();
})();

Some other URLs work fine, so I wonder if there is anything special with this particular URL?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:5

github_iconTop GitHub Comments

9reactions
Sachinjha469commented, Sep 30, 2019
 try {
    const response = await page.goto("https://www.gatsbyjs.com", {
      waitUntil: "networkidle2",
      timeout: 60000
    });

Changing “networkidle0” to “networkidle2” solved the issue in my case. Appears as multiple networks were hitting the same URL that’s y networkidle0 wasn’t working in the first place.

0reactions
stale[bot]commented, Jul 26, 2022

We are closing this issue. If the issue still persists in the latest version of Puppeteer, please reopen the issue and update the description. We will try our best to accomodate it!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does puppeteer page.goto() throw a timeout error?
Removing waitUntil: "networkidle0" works so I'm assuming the site is still holding a connection to the server.
Read more >
How to solve Puppeteer TimeoutError: Navigation timeout of ...
One of the most usual problems with pages that contain a lot of content, because of the ads, images etc. is the load...
Read more >
Puppeteer documentation - DevDocs
TimeoutError <function> A class of TimeoutError. Puppeteer methods might throw errors if they are unable to fulfill a request. For example, page.
Read more >
Dealing with timeouts in Puppeteer 🐢️
You are most likely using Puppeteer to interact with the web in some form. Either you are taking screenshots of a website using...
Read more >
Page | Playwright - CukeTest
Ensure that the element is now checked. If not, this method throws. When all steps combined have not finished during the specified timeout...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found