DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk3 min

How to Stop a Puppeteer Performance Trace

Await page.tracing.stop() to end a Puppeteer trace. Learn when to set a path, how to use the returned data, and how to handle multiple captures.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Stop an active Puppeteer performance trace with await page.tracing.stop(). If you need a trace file, pass a path when starting the trace; otherwise, use the data returned by stop().

Stop the trace and collect its data

The tracing API is exposed on a Puppeteer page as page.tracing. Start tracing, perform the page action you want to measure, then await stop():

As an Amazon Associate I earn from qualifying purchases.

const page = await browser.newPage();

await page.tracing.start({path: 'trace.json'});
await page.goto('https://example.com');
const trace = await page.tracing.stop();

stop() is asynchronous. Await it so tracing has stopped and its result has settled before you use the output. The documented return type is Uint8Array | undefined; when present, the buffer contains trace data. See Puppeteer’s Tracing.stop() API reference.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

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

Choose where the trace output goes

How you start tracing Where to get the output Best fit
Pass path to page.tracing.start() Puppeteer writes the trace to that path. You can also inspect the value returned by stop() when present. A persistent file you can open later.
Omit path Use the buffer returned by the awaited page.tracing.stop(), when present. Keeping trace data in memory for your workflow.

The API does not document output options on stop(); configure capture options when calling start(). Puppeteer describes trace files as viewable in Chrome DevTools or a timeline viewer. See the Tracing class reference and TracingOptions reference.

Configure capture before starting

The TracingOptions reference documents these options:

  • path: the output file path.
  • categories: trace categories to include or exclude; prefix a category with - to exclude it.
  • screenshots: whether to capture screenshots; defaults to false.
  • bufferSize: buffer size in kilobytes. If omitted or set to zero, the documented Chromium default is 200 MB (200,000 KB); the documentation does not state a year for this value.

Check the API documentation corresponding to your installed Puppeteer version. The official reference pages have shown version labels ranging from 25.3.0 to 25.12.0, so options and details should be verified against the version your project uses.

Capture multiple runs safely

Only one trace can be active at a time per browser. For repeated captures, stop the current trace before starting another. A simple sequential pattern is:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
for (const [index, url] of urls.entries()) {
  await page.tracing.start({path: `trace-${index}.json`});
  await page.goto(url);
  await page.tracing.stop();
}

Awaiting each stop ensures the preceding capture has ended before the next one starts.

Troubleshoot missing or unusable output

  • No trace file appears: confirm that path was provided to page.tracing.start(). Without it, retrieve the trace from the result of stop().
  • The in-memory result is missing: await page.tracing.stop() and check whether it returned a buffer; the declared return type also permits undefined.
  • You cannot start another capture: stop the active trace first. Puppeteer documents one active trace per browser.
  • The trace does not contain the expected capture settings: set categories, screenshots, buffer size, and output path at start time; stop() is not documented as accepting these options.
  • You are unsure how to inspect the saved file: Puppeteer identifies Chrome DevTools and timeline viewers as options for opening a trace file.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If you need a website screenshot rather than a Puppeteer performance trace, ScreenshotNeo provides a screenshot API and MCP server. A single GET request can return an image or PDF. This does not create a Puppeteer performance trace.

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

See the ScreenshotNeo documentation for request options. Cookie banners are accepted and removed along with supported newsletter popups and chat widgets before capture. Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed. An MCP server lets AI agents use screenshot tools, and the free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000.

Sign up for ScreenshotNeo’s free plan.

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.

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

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
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair 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.