react-snap icon indicating copy to clipboard operation
react-snap copied to clipboard

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

Open gprasanth24k opened this issue 4 years ago • 2 comments

on npm run build

this is the error it is throwing someone please help!

✅ crawled 11 out of 28 (/aig-cyberedge/) ✅ crawled 12 out of 28 (/resource/post/march-newsletter-stay-up-to-date-on-cyber-trends-with-bandura-2) 🔥 UnhandledPromiseRejectionWarning Error: Execution context was destroyed, most likely because of a navigation. at rewriteError (/Users/admin/Projects/Bandura/bandura-website/node_modules/puppeteer/lib/ExecutionContext.js:167:15) at runMicrotasks () at processTicksAndRejections (internal/process/task_queues.js:93:5) at async ExecutionContext._evaluateInternal (/Users/admin/Projects/Bandura/bandura-website/node_modules/puppeteer/lib/ExecutionContext.js:120:56) at async ExecutionContext.evaluate (/Users/admin/Projects/Bandura/bandura-website/node_modules/puppeteer/lib/ExecutionContext.js:48:12) at async Page. (/Users/admin/Projects/Bandura/bandura-website/node_modules/react-snap/index.js:214:7) -- ASYNC -- at ExecutionContext. (/Users/admin/Projects/Bandura/bandura-website/node_modules/puppeteer/lib/helper.js:111:15) at DOMWorld.evaluate (/Users/admin/Projects/Bandura/bandura-website/node_modules/puppeteer/lib/DOMWorld.js:112:20) at runMicrotasks () at processTicksAndRejections (internal/process/task_queues.js:93:5) -- ASYNC -- at Frame. (/Users/admin/Projects/Bandura/bandura-website/node_modules/puppeteer/lib/helper.js:111:15) at Page.evaluate (/Users/admin/Projects/Bandura/bandura-website/node_modules/puppeteer/lib/Page.js:833:43) at Page. (/Users/admin/Projects/Bandura/bandura-website/node_modules/puppeteer/lib/helper.js:112:23) at Page. (/Users/admin/Projects/Bandura/bandura-website/node_modules/react-snap/index.js:214:18) at Page.emit (events.js:327:22) at NetworkManager. (/Users/admin/Projects/Bandura/bandura-website/node_modules/puppeteer/lib/Page.js:111:69) at NetworkManager.emit (events.js:315:20) at NetworkManager._onResponseReceived (/Users/admin/Projects/Bandura/bandura-website/node_modules/puppeteer/lib/NetworkManager.js:272:10) at CDPSession.emit (events.js:315:20) at CDPSession._onMessage (/Users/admin/Projects/Bandura/bandura-website/node_modules/puppeteer/lib/Connection.js:200:12) -- ASYNC -- at Page. (/Users/admin/Projects/Bandura/bandura-website/node_modules/puppeteer/lib/helper.js:111:15) at Page. (/Users/admin/Projects/Bandura/bandura-website/node_modules/react-snap/index.js:214:18) at Page.emit (events.js:327:22) at NetworkManager. (/Users/admin/Projects/Bandura/bandura-website/node_modules/puppeteer/lib/Page.js:111:69) at NetworkManager.emit (events.js:315:20) at NetworkManager._onResponseReceived (/Users/admin/Projects/Bandura/bandura-website/node_modules/puppeteer/lib/NetworkManager.js:272:10) at CDPSession.emit (events.js:315:20) at CDPSession._onMessage (/Users/admin/Projects/Bandura/bandura-website/node_modules/puppeteer/lib/Connection.js:200:12) at Connection._onMessage (/Users/admin/Projects/Bandura/bandura-website/node_modules/puppeteer/lib/Connection.js:112:17) at WebSocket. (/Users/admin/Projects/Bandura/bandura-website/node_modules/puppeteer/lib/WebSocketTransport.js:44:24) ✅ crawled 13 out of 28 (/resource/post/bandura-threatconnect-proactively-block-threats-using-threat-intelligence) ✅ crawled 33 out of 35 (/integrations/) ✅ crawled 34 out of 35 (/about-us/)

gprasanth24k avatar Mar 03 '21 08:03 gprasanth24k

We just fixed a similar issue caused by react-snap attempting to crawl redirects we had in react-router.

      <Route
        exact
        path="/<route>"
        component={() => {
          if (navigator.userAgent !== "ReactSnap") {
            window.location.replace('<redirect>');
          }
          return null;
        }}
      />

HWideman avatar Mar 15 '22 19:03 HWideman

I can confirm @HWideman solution can solve the issue

phuochau avatar Apr 17 '22 03:04 phuochau