ScreenshottyScreenshotty
FeaturesDocumentationPricingBlog
ScreenshottyScreenshotty

Most cost-effective Screenshot API

Product

  • Features
  • Pricing
  • Documentation
  • Blog
  • Compare
  • Alternatives

Free Tools

  • Website Screenshot Tool
  • Website Responsivity Check
  • Website Text Extractor
  • Website to PDF Converter
  • Website Markdown Converter
  • All Free Tools

Developers

  • Python Screenshot API
  • Node.js Screenshot API
  • PHP Screenshot API
  • Full Page Screenshots
  • URL to PDF API
  • API Parameters
  • MCP Server

Legal

  • Privacy Policy
  • Terms of Service

© 2026 Screenshotty. All rights reserved.

ScreenshottyScreenshotty
FeaturesDocumentationPricingBlog
ScreenshottyScreenshotty

Most cost-effective Screenshot API

Product

  • Features
  • Pricing
  • Documentation
  • Blog
  • Compare
  • Alternatives

Free Tools

  • Website Screenshot Tool
  • Website Responsivity Check
  • Website Text Extractor
  • Website to PDF Converter
  • Website Markdown Converter
  • All Free Tools

Developers

  • Python Screenshot API
  • Node.js Screenshot API
  • PHP Screenshot API
  • Full Page Screenshots
  • URL to PDF API
  • API Parameters
  • MCP Server

Legal

  • Privacy Policy
  • Terms of Service

© 2026 Screenshotty. All rights reserved.

ScreenshottyScreenshotty
FeaturesDocumentationPricingBlog
page.waitForTimeout Is Not a Function in Puppeteer — Here's the Fix
Troubleshooting

page.waitForTimeout Is Not a Function in Puppeteer — Here's the Fix

Jun 10, 2026
•
4 min read
Sarah Chen
Sarah Chen
Developer Advocate

You upgraded Puppeteer and a script that worked for years now throws:


TypeError: page.waitForTimeout is not a function


Nothing is wrong with your code's logic — the method is gone. `page.waitForTimeout()` was deprecated in Puppeteer 21 and **removed in Puppeteer 22** (early 2024). Every tutorial written before then still tells you to use it, which is why this error keeps appearing in new projects.


The direct replacement


If you just need the old behavior back, use a plain promise-based sleep:


const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));


await page.goto("https://example.com");

await sleep(2000);

await page.screenshot({ path: "screenshot.png" });


Node 16+ also ships one in the standard library:


import { setTimeout as sleep } from "node:timers/promises";


await sleep(2000);


The better replacement: wait for a condition


Puppeteer removed the method deliberately — fixed sleeps are the leading cause of flaky automation. Two seconds is too long on a fast page and too short on a slow one. Wait for the thing you actually need:


// Wait for an element to exist

await page.waitForSelector(".chart-rendered");


// Wait for an arbitrary condition

await page.waitForFunction(() => window.dataLoaded === true);


// Wait for the network to go quiet

await page.waitForNetworkIdle({ idleTime: 500 });


Each of these resolves the moment the page is ready, instead of guessing.


If the sleep was for screenshots


A very common reason for `waitForTimeout` in old scripts is "give the page time to finish rendering before the screenshot." That is a solved problem in a screenshot API — readiness handling is a parameter, not a guess:


const response = await fetch("https://api.screenshotty.link/api/v1/screenshot", {

method: "POST",

headers: {

"X-Api-Key": process.env.SCREENSHOTTY_API_KEY,

"Content-Type": "application/json",

},

body: JSON.stringify({

url: "https://example.com",

ready_event: "networkidle", // wait for the network to settle

wait_ms: 1000, // optional extra settle time

scroll_to_bottom: true, // trigger lazy-loaded content

}),

});


No Puppeteer versions to track, no removed methods, no browser fleet. [Screenshotty](/) has a free tier of 100 screenshots per month — see the [Node.js screenshot guide](/screenshot-api/nodejs) or try the [free screenshot tool](/website-screenshot) first.


Summary


  • `page.waitForTimeout` was removed in Puppeteer 22 — the error means your Puppeteer is newer than your code.
  • Quick fix: a promise-based `sleep()` helper or `node:timers/promises`.
  • Right fix: `waitForSelector`, `waitForFunction`, or `waitForNetworkIdle` — wait for conditions, not clocks.
  • For screenshot pipelines, a screenshot API makes readiness a declarative parameter.

  • Want to learn more?

    Explore our documentation and start building with Screenshotty

    ScreenshottyScreenshotty

    Most cost-effective Screenshot API

    Product

    • Features
    • Pricing
    • Documentation
    • Blog
    • Compare
    • Alternatives

    Free Tools

    • Website Screenshot Tool
    • Website Responsivity Check
    • Website Text Extractor
    • Website to PDF Converter
    • Website Markdown Converter
    • All Free Tools

    Developers

    • Python Screenshot API
    • Node.js Screenshot API
    • PHP Screenshot API
    • Full Page Screenshots
    • URL to PDF API
    • API Parameters
    • MCP Server

    Legal

    • Privacy Policy
    • Terms of Service

    © 2026 Screenshotty. All rights reserved.