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

fix(playwright): Add missing await on page.evaluate #1063

Merged
merged 2 commits into from
May 15, 2024

Conversation

KuSh
Copy link
Contributor

@KuSh KuSh commented May 14, 2024

Hi,

This missing await causes us many, hard to debug problems, when page has been closed prematurely (popup or terminating analysis if too long)

Simple reproduction :

(async () => {
  const browser = await playwright.chromium.launch({ headless: true });
  const context = await browser.newContext();
  const page = await context.newPage();
  await page.close();
  try {
    const results = await new AxeBuilder({ page }).analyze();
    console.log(results);
  } catch (error) {
    console.error(error);
  }
  await browser.close();
})();
// node:internal/process/promises:279
            triggerUncaughtException(err, true /* fromPromise */);
            ^
 page.evaluate: Target page, context or browser has been closed

I haven't been able to write a simple test that reproduce the problem but I can reproduce it in my project and adding that await fixed all my problems

No QA needed

@KuSh KuSh requested a review from a team as a code owner May 14, 2024 15:45
@CLAassistant
Copy link

CLAassistant commented May 14, 2024

CLA assistant check
All committers have signed the CLA.

@KuSh KuSh changed the title Add missing await on page.evaluate fix(playwright): Add missing await on page.evaluate May 14, 2024
@straker
Copy link
Contributor

straker commented May 14, 2024

Thanks for the pr! Before we can merge it you'll need to sign our CLA, but it's not working at the moment. Once we get that fixed I'll let you know, then we can work on getting this merged in.

@straker
Copy link
Contributor

straker commented May 15, 2024

Going to close / reopen this pr to retrigger the cla bot, which should be working now.

@straker straker closed this May 15, 2024
@straker straker reopened this May 15, 2024
@straker
Copy link
Contributor

straker commented May 15, 2024

Review for security

@straker straker merged commit 20b8bbf into dequelabs:develop May 15, 2024
59 of 62 checks passed
@KuSh KuSh deleted the patch-1 branch May 15, 2024 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants