question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

waitForNavigation Error: Execution context was destroyed, most likely because of a navigation.

See original GitHub issue

I have the following test:

 it("Should not have to open Knhb when logging in again whilst still being logged in in SSO", async () => {
        await page.goto("http://localhost:3000");
        await expect(await page.evaluate(() => {
            localStorage.clear();
            return localStorage.getItem("id_token");
        })).toBe(null);
        await Promise.all([
            page.waitForNavigation(),
            page.goto("http://localhost:3000/matches")
        ]);
        await expect(await page.title()).toBe("Digitaal Wedstrijd Formulier");
    });

It opens a page which redirects a few times, after all the redirects are done it should continue. Instead of waiting it throws the following error:

Error: Execution context was destroyed, most likely because of a navigation.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
aslushnikovcommented, Mar 15, 2019

@stoplion please file a separate issue with details so that we can repro this. I’ll close this since it’s not actionable.

0reactions
aslushnikovcommented, Apr 29, 2019

@best-coupon-codes please do, but make sure to include a good reproduction script so that we can reproduce it locally. Otherwise it would not be actionable.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Execution context was destroyed, most likely because of a ...
goto, then I get a "Execution context was destroyed, most likely because of a navigation" error. If I add. currentPage.waitForNavigation({ ...
Read more >
Puppeteer Execution context was destroyed, most likely ...
Problem. The error means that you are accessing data which has become obsolete/invalid because of navigation. In your script the error ...
Read more >
Puppeteer: "Execution context was destroyed, most likely ...
To fix the “execution context was destroyed, most likely because of a navigation” error, use the page.waitForNavigation() function: const ...
Read more >
playwright._impl._api_types.error: execution context was ...
To fix the “execution context was destroyed, most likely because of a navigation” error, use the page.waitForNavigation () function: The page.waitForNavigation ...
Read more >
Puppeteer – Execution context was destroyed, most likely ...
Puppeteer – Execution context was destroyed, most likely because of a navigation – Daily IT Help.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found