From c06394fe6b1242e9d90e0f3f5f025751888d5942 Mon Sep 17 00:00:00 2001 From: Sergey Fedosimov Date: Fri, 5 Mar 2021 12:06:00 +0300 Subject: [PATCH] Fix an issue with "ERROR Execution context was destroyed, most likely because of a navigation." --- lib/generate/collector/checkout.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/generate/collector/checkout.js b/lib/generate/collector/checkout.js index 61fa854..80b57d9 100644 --- a/lib/generate/collector/checkout.js +++ b/lib/generate/collector/checkout.js @@ -35,7 +35,7 @@ const checkout = async ( await authenticate(page, authUsername, authPassword); - await page.goto(productUrl, { waitUntil: 'networkidle0' }); + await page.goto(productUrl, { waitUntil: 'domcontentloaded' }); // Select option for every swatch if there are any. await page.evaluate(() => { @@ -73,7 +73,7 @@ const checkout = async ( }); await Promise.all([ - page.waitForNavigation({ waitUntil: 'networkidle0' }), + page.waitForNavigation({ waitUntil: 'domcontentloaded' }), page.evaluate(() => document.querySelector('#product_addtocart_form').submit() ), @@ -81,10 +81,10 @@ const checkout = async ( const baseUrl = await page.evaluate(() => BASE_URL); - await page.goto(`${baseUrl}checkout/cart`, { waitUntil: 'networkidle0' }); + await page.goto(`${baseUrl}checkout/cart`, { waitUntil: 'domcontentloaded' }); const cartModules = await collectModules(page); - await page.goto(`${baseUrl}checkout`, { waitUntil: 'networkidle0' }); + await page.goto(`${baseUrl}checkout`, { waitUntil: 'domcontentloaded' }); const checkoutModules = await collectModules(page); merge(bundleConfig.modules, cartModules, checkoutModules);