Skip to content
This repository has been archived by the owner on Apr 9, 2023. It is now read-only.

"Navigation failed because browser has disconnected!" but Puppeteer is outdated (1.7.x instead of 2.0.0) #423

Open
hermanbanken opened this issue Jan 15, 2021 · 1 comment

Comments

@hermanbanken
Copy link

When running this plugin I see the error

⠼  Building for production...
[prerender-spa-plugin] Unable to prerender all routes!

After inspecting the source I added an additional console.error(err); process.exit(1); right before

        PrerendererInstance.destroy()
        const msg = '[prerender-spa-plugin] Unable to prerender all routes!'

This shows me the error message is "Navigation failed because browser has disconnected!"

Full stacktrace
Navigation failed because browser has disconnected!
    at CDPSession.LifecycleWatcher._eventListeners.helper.addEventListener (/project/node_modules/puppeteer/lib/LifecycleWatcher.js:46:107)
Navigation failed because browser has disconnected!
    at CDPSession.LifecycleWatcher._eventListeners.helper.addEventListener (/project/node_modules/puppeteer/lib/LifecycleWatcher.js:46:107)
    at CDPSession.emit (events.js:198:13)
    at CDPSession._onClosed (/project/node_modules/puppeteer/lib/Connection.js:215:10)
    at Connection._onClose (/project/node_modules/puppeteer/lib/Connection.js:138:15)
    at WebSocketTransport._ws.addEventListener.event (/project/node_modules/puppeteer/lib/WebSocketTransport.js:48:22)
    at WebSocket.onClose (/project/node_modules/ws/lib/event-target.js:124:16)
    at WebSocket.emit (events.js:198:13)
    at WebSocket.emitClose (/project/node_modules/ws/lib/websocket.js:191:10)
    at Socket.socketOnClose (/project/node_modules/ws/lib/websocket.js:850:15)
    at Socket.emit (events.js:198:13)
    at TCP._handle.close (net.js:607:12)
  -- ASYNC --
    at Frame.<anonymous> (/project/node_modules/puppeteer/lib/helper.js:111:15)
    at Page.goto (/project/node_modules/puppeteer/lib/Page.js:674:49)
    at Page.<anonymous> (/project/node_modules/puppeteer/lib/helper.js:112:23)
    at limiter (/project/node_modules/@prerenderer/renderer-puppeteer/es6/renderer.js:113:24)
    at process._tickCallback (internal/process/next_tick.js:68:7)

Googling that I don't get much, except that people are using Puppeteer 2.0 now.

So there are 2 individual issues:

  1. outdated Puppeteer via several levels of node_module dependencies
  2. error is swallowed

Extra information, puppeteer is installing Chromium r686378 atm:

> puppeteer@1.20.0 install /project/node_modules/puppeteer
> node install.js

Downloading Chromium r686378 - 110.2 Mb [====================] 100% 0.0s
Chromium downloaded to /project/node_modules/puppeteer/.local-chromium/mac-686378
@hussein661
Copy link

[prerender-spa-plugin] : Unable to prerender all routes!

I have only 1 route and Ive set maxConcurrentRoutes: 1 and the issue still not fixed since 2 days .
The error is not clear enough and i need to fix that !!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants