Puppeteer waitForTimeout is not a function

Viewed 7316

I am using puppeteer in my latest project. I installed the library using NPM (npm i puppeteer). From the documentation I understood that page.waitFor() function was now deprecated and replaced by page.waitForTimeout().

When I try to use the new function I get UnhandledPromiseRejectionWarning: TypeError: page.waitForTimeout is not a function.

What could be the possible reason? The version of puppeteer I got from NPM is 2.1.1.

Thanks

1 Answers

page.waitForTimeout has been introduced in puppeteer version 5.3.0.

So as was mentioned in the comments, you can't use this new function in version 2.1.1 you had installed.

Bonus: Issue #6214 contains more details to this topic.

Related