You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constpuppeteer=require('puppeteer');(async()=>{constbrowser=awaitpuppeteer.launch({headless: "new"});constpage=awaitbrowser.newPage();try{awaitpage.goto('https://www.google.com/');console.log('Navigated to Google website.');// Wait for 2 seconds using page.waitForTimeoutawaitpage.waitForTimeout(2000);console.log('Waited for 2 seconds using page.waitForTimeout');}catch(error){console.error('Error occurred:',error);}finally{awaitbrowser.close();}})();
Error string
Error occurred: TypeError: page.waitForTimeout is not a function
Bug behavior
Flaky
PDF
Background
I was trying to use waitForTimeout function in my nodejs puppeteer program, but it shows TypeError for the past two days.
I have updated my puppeteer version from 21.9.0 to 22.7.1 before running the program. I run the program several time afterwards but it gets the same TypeError.
So I downgrade my puppeteer version to 21.9.0 and run the program afterwards and this time I don't find any error, which lead me to think that its definitely a bug in this new version.
Then I created this simple puppeteer code to demonstrate the error i am encountering with the latest version.
Expectation
The code working is simple as you can see it yourself.
When run, this code goes to google website and then wait for two seconds and close it.
Reality
But it shows the TypeError on the waitForTimeout function.
Puppeteer configuration file (if used)
No response
Puppeteer version
22.7.1
Node version
20.11.1
Package manager
npm
Package manager version
10.5.2
Operating system
Windows
The text was updated successfully, but these errors were encountered:
This issue was not reproducible. Please check that your example runs locally and the following:
Ensure the script does not rely on dependencies outside of puppeteer and puppeteer-core.
Ensure the error string is just the error message.
Bad:
Error: somethingwentwrongatObject.<anonymous>(/Users/username/repository/script.js:2:1)atModule._compile(node:internal/modules/cjs/loader:1159:14)atModule._extensions..js(node:internal/modules/cjs/loader:1213:10)atModule.load(node:internal/modules/cjs/loader:1037:32)atModule._load(node:internal/modules/cjs/loader:878:12)atFunction.executeUserEntryPoint[asrunMain](node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:23:47
Good: Error: something went wrong.
Ensure your configuration file (if applicable) is valid.
If the issue is flaky (does not reproduce all the time), make sure 'Flaky' is checked.
If the issue is not expected to error, make sure to write 'no error'.
Once the above checks are satisfied, please edit your issue with the changes and we will
try to reproduce the bug again.
YAnubhavChetan
changed the title
[Bug]: 'page.waitForTimeout' not working in Puppeteer 22.7.0
[Bug]: 'page.waitForTimeout' not working in Puppeteer 22.7.1
Apr 25, 2024
Minimal, reproducible example
Error string
Error occurred: TypeError: page.waitForTimeout is not a function
Bug behavior
Background
I was trying to use waitForTimeout function in my nodejs puppeteer program, but it shows TypeError for the past two days.
I have updated my puppeteer version from 21.9.0 to 22.7.1 before running the program. I run the program several time afterwards but it gets the same TypeError.
So I downgrade my puppeteer version to 21.9.0 and run the program afterwards and this time I don't find any error, which lead me to think that its definitely a bug in this new version.
Then I created this simple puppeteer code to demonstrate the error i am encountering with the latest version.
Expectation
The code working is simple as you can see it yourself.
When run, this code goes to google website and then wait for two seconds and close it.
Reality
But it shows the TypeError on the waitForTimeout function.
Puppeteer configuration file (if used)
No response
Puppeteer version
22.7.1
Node version
20.11.1
Package manager
npm
Package manager version
10.5.2
Operating system
Windows
The text was updated successfully, but these errors were encountered: