Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: #9930

Closed
2 tasks
draugael opened this issue Mar 28, 2023 · 7 comments
Closed
2 tasks

[Bug]: #9930

draugael opened this issue Mar 28, 2023 · 7 comments

Comments

@draugael
Copy link

draugael commented Mar 28, 2023

failed: Runtime.callFunctionOn timed out error

I expect puppeteer to wait until the "Captions (c)" aria-label appears on the browser.

instead I got an error

Bug behavior

  • Flaky
  • PDF

Minimal, reproducible example

import puppeteer from "puppeteer";

(async () => {
    await puppeteer.launch({
        headless: false,
        executablePath: "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe",
    }).then(async browser => {
        const page = await browser.newPage();
        await page.setDefaultTimeout(0);
        await page.setViewport({ width: 1280, height: 720 })
        await page.goto(
            'https://player.twitch.tv/?parent=twitch.tv&video=1774449542&autoplay=true',
            { waitUntil: ["networkidle2", "domcontentloaded"] }
        );
        await page.waitForSelector(
            'aria/Captions (c)',
            { timeout: 0 }
        );
    })
})();

Error string

ProtocolError: Waiting for selector Captions (c) failed: Runtime.callFunctionOn timed out.

Puppeteer configuration

No response

Puppeteer version

19.8.0

Node version

18.15.0

Package manager

npm

Package manager version

8.19.2

Operating system

Windows

@draugael draugael added the bug label Mar 28, 2023
@OrKoN
Copy link
Collaborator

OrKoN commented Mar 28, 2023

This is the same issue as #9927

@OrKoN OrKoN closed this as not planned Won't fix, can't repro, duplicate, stale Mar 28, 2023
@github-actions
Copy link

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: something went wrong
        at Object.<anonymous> (/Users/username/repository/script.js:2:1)
        at Module._compile (node:internal/modules/cjs/loader:1159:14)
        at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
        at Module.load (node:internal/modules/cjs/loader:1037:32)
        at Module._load (node:internal/modules/cjs/loader:878:12)
        at Function.executeUserEntryPoint [as runMain] (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.


Analyzer run

@draugael
Copy link
Author

draugael commented Mar 28, 2023

I see, I found a way to temporarily solve my issue.

// use a while loop to increase timeout because timeout not working properly (https://github.com/puppeteer/puppeteer/issues/9927)
let element;
while (!element) {
    try {
        element = await page.waitForSelector('aria/Captions (c)');
        await element?.click();
    } catch (error) {
        console.log(error);
    }
}

@OrKoN
Copy link
Collaborator

OrKoN commented Mar 28, 2023

You can also set the protocolTimeout: 0 or protocolTimeout: sufficientlyHighValue in the launch function.

@draugael
Copy link
Author

Both solutions are not working for me. The limit seems to be 30000ms in every case.

@OrKoN
Copy link
Collaborator

OrKoN commented Mar 28, 2023

import puppeteer from "puppeteer";

(async () => {
    await puppeteer.launch({
        headless: false,
        executablePath: "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe",
        protocolTimeout: 0,
    }).then(async browser => {
        const page = await browser.newPage();
        await page.setDefaultTimeout(0);
        await page.setViewport({ width: 1280, height: 720 })
        await page.goto(
            'https://player.twitch.tv/?parent=twitch.tv&video=1774449542&autoplay=true',
            { waitUntil: ["networkidle2", "domcontentloaded"] }
        );
        await page.waitForSelector(
            'aria/Captions (c)',
            { timeout: 0 }
        );
    })
})();

works for me (meaning I get no timeout errors).

@draugael
Copy link
Author

I have maybe done something wrong. Indeed It's working thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants