October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk3 min

How to Set a Navigation Timeout in Puppeteer

Use setDefaultNavigationTimeout() for page-wide navigation limits or pass timeout for one call. Learn the millisecond units, scope, and common failure causes.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Set a page-wide navigation limit with page.setDefaultNavigationTimeout(timeoutInMilliseconds), or set timeout on a single navigation call. Puppeteer measures both values in milliseconds: 60_000 is 60 seconds, and 0 disables the timeout for that call.

Set a default timeout for page navigation

Call page.setDefaultNavigationTimeout() on a Puppeteer Page before the navigation you want it to govern:

As an Amazon Associate I earn from qualifying purchases.

page.setDefaultNavigationTimeout(60_000); // 60 seconds
await page.goto('https://example.com');

The setting applies to page.goBack(), page.goForward(), page.goto(), page.reload(), page.setContent(), and page.waitForNavigation(). Its argument is a maximum duration in milliseconds. See the Puppeteer 25.12.0 method reference.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Override the timeout for one navigation

Pass timeout in the options for a single call when you do not want to change the page-wide navigation default:

await page.goto('https://example.com', { timeout: 60_000 });

The documented default for wait options is 30,000 milliseconds. Set timeout: 0 to disable the limit for that call. The WaitForOptions reference documents these values, and the Frame.goto reference covers navigation options and failure conditions.

Choose the setting with the right scope

Setting Scope Use it when
page.setDefaultNavigationTimeout(ms) Navigation methods on that page You want the same navigation limit for relevant calls such as goto(), reload(), or waitForNavigation().
Per-call timeout One navigation or wait Only a particular operation needs a different limit.
page.setDefaultTimeout(ms) Broader page wait defaults You intend to adjust general page waits, not only navigation limits. See the Page.setDefaultTimeout reference.

Use the navigation-specific method when you mean to change navigation behavior. The Page class documentation distinguishes it from the broader default timeout: Puppeteer 25.12.0 Page reference.

Understand what a timeout does—and does not—fix

A longer timeout gives a navigation more time before Puppeteer stops waiting; it does not guarantee that the page can load. Puppeteer also documents invalid URLs, SSL errors, unreachable servers, and main-resource failures as navigation failure conditions. Increasing the limit will not resolve those underlying problems.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Troubleshoot a navigation that still fails

  • It times out sooner than intended: confirm that the value is in milliseconds and that the setting is applied to the same Page before the relevant call. Check for a per-call timeout that overrides the default.
  • A non-navigation wait still uses its old limit: setDefaultNavigationTimeout() is navigation-specific. Use page.setDefaultTimeout() only when you intend to change broader page wait defaults.
  • The error is not a timeout: inspect the URL and browser/network conditions. Invalid URLs, SSL problems, an unreachable server, or a main-resource failure require fixing the cause, not just extending the wait.
  • You set timeout: 0: this disables the timeout rather than choosing a very large finite limit. Use it only when an unbounded wait is appropriate for your workflow.

Or skip the browser setup

If your goal is a website screenshot rather than controlling a Puppeteer navigation in your own browser session, ScreenshotNeo can return an image or PDF with one GET request. Its capture flow accepts cookie/consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each of those steps can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status. It also offers an MCP server for AI agents.

Example using cURL; see the ScreenshotNeo API documentation for options:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp

The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 screenshots. Sign up for free ScreenshotNeo screenshots.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Frequently Asked Questions

What unit does Puppeteer use for navigation timeouts?

Milliseconds. For example, 60,000 is 60 seconds.

Does a navigation timeout apply to `waitForNavigation()`?

Yes. `page.setDefaultNavigationTimeout()` applies to `page.waitForNavigation()` as well as the other listed navigation methods.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
The SQL Programming Language: .
  • Used Book in Good Condition

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.