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 an issue with "ERROR Execution context was destroyed, most likelybecause of a navigation." #92

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sergey-fedosimov
Copy link

$ magepack generate --cms-url="https://example.com/" --category-url="https://example.com/category.html" --product-url="https://example.com/some-product-page.html"

ℹ Collecting bundle modules in the browser.                                                                                                                                                                                                       11:55:23
ℹ Collecting modules for bundle "category".                                                                                                                                                                                                       11:55:23
✔ Finished collecting modules for bundle "category".                                                                                                                                                                                              11:55:36
ℹ Collecting modules for bundle "cms".                                                                                                                                                                                                            11:55:36
✔ Finished collecting modules for bundle "cms".                                                                                                                                                                                                   11:55:47
ℹ Collecting modules for bundle "product".                                                                                                                                                                                                        11:55:47
✔ Finished collecting modules for bundle "product".                                                                                                                                                                                               11:55:59
ℹ Collecting modules for bundle "checkout".                                                                                                                                                                                                       11:55:59

 ERROR  Execution context was destroyed, most likely because of a navigation.                                                                                                                                                                     11:56:11

  at rewriteError (/usr/local/lib/node_modules/magepack/node_modules/puppeteer/lib/ExecutionContext.js:167:15)
  at runMicrotasks (<anonymous>)
  at processTicksAndRejections (node:internal/process/task_queues:94:5)
  at async ExecutionContext._evaluateInternal (/usr/local/lib/node_modules/magepack/node_modules/puppeteer/lib/ExecutionContext.js:120:56)
  at async ExecutionContext.evaluate (/usr/local/lib/node_modules/magepack/node_modules/puppeteer/lib/ExecutionContext.js:48:12)
  at async Object.checkout (/usr/local/lib/node_modules/magepack/lib/generate/collector/checkout.js:82:21)
  at async module.exports (/usr/local/lib/node_modules/magepack/lib/generate.js:24:13)
  -- ASYNC --
  at ExecutionContext.<anonymous> (/usr/local/lib/node_modules/magepack/node_modules/puppeteer/lib/helper.js:111:15)
  at DOMWorld.evaluate (/usr/local/lib/node_modules/magepack/node_modules/puppeteer/lib/DOMWorld.js:112:20)
  at runMicrotasks (<anonymous>)
  at processTicksAndRejections (node:internal/process/task_queues:94:5)
  -- ASYNC --
  at Frame.<anonymous> (/usr/local/lib/node_modules/magepack/node_modules/puppeteer/lib/helper.js:111:15)
  at Page.evaluate (/usr/local/lib/node_modules/magepack/node_modules/puppeteer/lib/Page.js:860:43)
  at Page.<anonymous> (/usr/local/lib/node_modules/magepack/node_modules/puppeteer/lib/helper.js:112:23)
  at Object.checkout (/usr/local/lib/node_modules/magepack/lib/generate/collector/checkout.js:82:32)
  at runMicrotasks (<anonymous>)
  at processTicksAndRejections (node:internal/process/task_queues:94:5)
  at async module.exports (/usr/local/lib/node_modules/magepack/lib/generate.js:24:13)

@krzksz
Copy link
Collaborator

krzksz commented Mar 6, 2021

Hey @sergey-fedosimov, thanks for contribution!

Can you explain a bit the issue we are trying to fix here? Originally, my idea for waiting for networkidle0 was to catch all of the modules that are loaded on the page and I don't think we should throw it out, at least at the places where it comes before await collectModules(page);.

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.

2 participants