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

Protocol error (Page.navigate): Target closed means Puppeteer lost the page target or its DevTools protocol session before the navigation operation completed. It does not, by itself, identify why. Start by checking whether navigation is still running when cleanup closes a page or browser; then investigate disconnects, crashes, launch compatibility, and navigation synchronization.

What the error means

Puppeteer sends browser commands over the Chrome DevTools Protocol. During page.goto(), the page target or its protocol session can disappear before the navigation command finishes. Puppeteer then reports that the target is closed. The message describes the failed operation, not a single root cause.

A Puppeteer issue reported the same error with a simple launch, new-page, navigation, and screenshot example. That report does not establish a universal cause or show that every occurrence is a coding mistake: Puppeteer issue #7455. Treat the error as a clue to trace the page and browser lifecycle.

First check: is cleanup racing navigation?

Look through the failing path for a navigation promise that was started but not awaited, followed by code that closes a page, browser context, or browser. Cleanup may be in a finally block, an early-return path, a timeout handler, a worker shutdown routine, or a process signal handler. The relevant question is whether the navigation has actually finished before something tears down its target.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

This illustrates the race:

const page = await browser.newPage();
page.goto('https://example.com'); // Not awaited
await browser.close(); // Can run while navigation is pending

Await the work whose completion you depend on, and ensure cleanup does not run until that work settles:

import puppeteer from 'puppeteer';

const browser = await puppeteer.launch();
try {
  const page = await browser.newPage();
  const response = await page.goto('https://example.com');
  console.log('HTTP status:', response?.status());
} finally {
  await browser.close();
}

This is a lifecycle-safe minimal pattern, not a cure for a browser crash or an external process closing the page. Also inspect the surrounding control flow, not just the visible goto() line:

  • Check for un-awaited calls to page.goto(), clicks, or helper functions that return promises.
  • Check whether Promise.race timeouts, abort handlers, request cancellation, or early returns leave navigation running while cleanup proceeds.
  • Check worker shutdown, signal handlers, and finally blocks for page, context, or browser closure.
  • In shared-browser services, confirm that one request cannot close a browser another request is using.

A community example demonstrates the missing-await/cleanup race, but it is one possible explanation rather than a diagnosis for every case: Stack Overflow: Puppeteer Protocol error (Page.navigate): Target closed.

Synchronize clicks that trigger navigation

If a click is expected to navigate, start waiting for navigation before triggering the click. Otherwise a fast navigation can begin before the wait is registered. Puppeteer documents this pattern:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
const [response] = await Promise.all([
  page.waitForNavigation(),
  page.click('a.my-link'),
]);

console.log('Navigation response:', response?.status() ?? 'No response object');

Multiple redirects resolve with the response for the last redirect. Anchor changes and History API navigations can resolve with null, so a missing response object does not necessarily mean the wait failed. See the Puppeteer Page.waitForNavigation API.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

This pattern coordinates an action that indirectly causes navigation; it does not reopen a closed target. For a direct page.goto(), the call itself is the navigation operation. Do not add a second navigation wait around every goto() by default.

Find out whether the browser disconnected or crashed

If promise ordering and ownership look correct, determine whether the browser process or protocol connection disappeared. Record when the error occurs and preserve relevant output before changing launch options.

Listen for browser disconnects

Register a disconnect listener after launch so your logs distinguish an unexpected browser disconnect from an ordinary navigation failure:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
browser.on('disconnected', () => {
  console.error('Puppeteer browser disconnected');
});

A disconnect event tells you the connection ended; it does not by itself prove whether the browser crashed, was closed by another owner, or lost its connection for another reason.

Capture browser and protocol diagnostics

Puppeteer’s debugging guide describes several ways to investigate different layers of a failure: headful or slow-motion debugging, page console capture, DevTools protocol logging, inspection of pending protocol callbacks, and forwarding browser output with dumpio. There is no single method that diagnoses every issue, because Puppeteer interacts with multiple browser components, including network requests and Web APIs. See the Puppeteer Debugging guide.

Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

For example, launch with browser output forwarded to the Node.js process:

const browser = await puppeteer.launch({ dumpio: true });

For protocol-level logs, the guide documents setting NODE_DEBUG="puppeteer:*" in the environment. It also describes inspecting browser.debugInfo.pendingProtocolErrors when protocol callbacks remain pending. Protocol logs can contain sensitive page or request information; redact them before sharing.

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.

Check who owns the browser and what cleanup does

Review every component that can close or disconnect Puppeteer, including the request handler, worker manager, application shutdown code, and any shared browser pool. The distinction between the two browser methods matters:

  • browser.close() closes the browser and its associated pages.
  • browser.disconnect() disconnects Puppeteer from the browser but leaves the browser and pages running.

These behaviors are documented in Puppeteer’s browser management guide. In a service that shares a browser instance, define which component owns shutdown. A request-scoped task should not close a browser still in use by other tasks.

Record versions before changing launch settings

Capture the Node.js version, Puppeteer package version, browser version, operating system or container base, and how Puppeteer connects to Chrome: its bundled browser, a system-installed executable, or a remote browser. Include a minimal reproduction and relevant redacted logs when asking for help. These details help distinguish code-level lifecycle problems from launch or environment problems.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

Puppeteer’s LaunchOptions documentation says it is “only guaranteed to work with the bundled browser.” If you use a custom executable or a remote browser, investigate that configuration and its version compatibility rather than assuming it caused the error. The LaunchOptions page searched for this guide identifies itself as version 25.12.0; labels and supported options can change, so consult the documentation for your installed release: Puppeteer LaunchOptions.

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

If browser output shows a launch failure or crash, use the troubleshooting guidance that matches your Puppeteer version and environment. The Puppeteer troubleshooting page is under /next/, so its advice may be version-sensitive. It covers environment-dependent issues such as missing system dependencies, browser cache, and sandbox or AppArmor behavior: Puppeteer Troubleshooting. Do not add --no-sandbox as a routine fix; disabling the sandbox is strongly discouraged in that guidance.

Check request interception if navigation stalls

This branch applies only if your code enables request interception. Puppeteer documents that intercepted requests stall until they are continued, responded to, or aborted (unless satisfied by cache). Inspect every handler path to ensure it completes the request appropriately:

page.on('request', request => {
  if (shouldBlock(request)) {
    return request.abort();
  }
  return request.continue();
});

Adapt the decision and error handling to your application; the key is that every intercepted request reaches an appropriate completion path. A stalled request can affect navigation progress, but request interception is not established as a general cause of Target closed. See the Puppeteer request interception API.

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

Choose the next diagnostic branch

Evidence or symptom Focus next
Navigation is not awaited, or cleanup can run before it settles Fix promise ordering and inspect all page, context, and browser cleanup paths.
Browser emits a disconnect event or browser output ends unexpectedly Check browser ownership, process output, protocol logs, and environment-specific crash evidence.
The failure follows a click that changes pages Register waitForNavigation() alongside the click with Promise.all.
Request interception is enabled and navigation hangs Check that each intercepted request is continued, answered, or aborted as appropriate.
A custom Chrome executable or remote browser is in use Record exact versions and inspect compatibility and launch logs before altering flags.

A retry loop may obscure a deterministic race without repairing it. First establish whether the page still exists, whether the browser remains connected, and which component owns cleanup.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

Or skip the browser setup

If the goal is to obtain a website screenshot rather than manage a Puppeteer browser lifecycle, ScreenshotNeo provides a screenshot API and MCP server. One GET request can return an image or PDF. For example, cURL:

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

See the ScreenshotNeo API documentation for request options and response details. ScreenshotNeo accepts cookie or consent banners like a visitor and removes 60+ known consent platforms, newsletter popups, and chat widgets before capture; individual steps can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and responses identify the page verdict and billing status in headers. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents and MCP clients.

The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000. Every feature is available on every plan. This is an alternative for screenshot capture, not a fix for incorrect Puppeteer lifecycle handling in code you still need to run.

Sign up for ScreenshotNeo’s free plan: 1,000 screenshots a month, no card required.

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

Frequently Asked Questions

Does `Target closed` always mean I forgot `await`?

No. A missing `await` is a common lifecycle race to check first, but the message can also accompany a disconnect, crash, or other loss of the page target or protocol session.

Should I add `–no-sandbox` to fix this error?

Not as a general fix. First use browser logs and environment evidence to identify a launch or sandbox issue; Puppeteer’s troubleshooting guidance strongly discourages disabling the sandbox as routine practice.

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.