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.

Unable to prerender all routes!

See original GitHub issue

Hello everyone, everything good? I am in trouble, when I run the command npm run build this message appears:

[prerender-spa-plugin] Unable to prerender all routes! (node:24767) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 3): Error: Protocol error (Page.navigate): Cannot navigate to invalid URL undefined (node:24767) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

But my app has a protection (main.js) that depends on a choice to continue.

router.beforeEach((to, from, next) => {
  // check if the user item is already set
  if (to.path !== '/painel' && !window.sessionStorage.getItem('programaId')) {
    next('painel')
  } else {
    next()
  }
})

My question is: is there a way to trigger prerender after that choice?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7

github_iconTop GitHub Comments

2reactions
renatodolzacommented, Apr 20, 2018

I put headless: false, opened the Chromium, but I could not identify what it was, I went in the config I took the event to run after the element exists, then finished the construction. I opened the dist folder and had a ‘/panel’ index, even though it ran the other routes, it did not work the way I imagined it to. Thanks for the effort!

1reaction
JoshTheDerfcommented, Apr 20, 2018

You could use renderAfterDocumentEvent and dispatch an event after the relevant components mount. However, it would appear your config contains an undefined value as a route, which is causing the error here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to prerender all routes! · Issue #242 - GitHub
Unable to prerender all routes ! I'm using v3.3.0 with the latest PR from Tribex. I'm watching the routes come up in headless...
Read more >
How to fix [prerender-spa-plugin] Unable to prerender all routes
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not...
Read more >
ERROR [prerender-spa-plugin] - Unable to prerender all routes
I have encountered a problem in implementing the prerender-spa-plugin with Laravel 5.7 and Vue 2.6: Error: Child compilation failed: Entry ...
Read more >
prerender-spa-plugin - Bountysource
[prerender-spa-plugin] Unable to prerender all routes! (node:2685) UnhandledPromiseRejectionWarning: Error: Navigation Timeout Exceeded: 30000ms exceeded at ...
Read more >
How to prerender a Vuejs 3 application with Vue Cli? - Get Help
After that I try prerender-spa-plugin but I have an error wheh I make a npm run build : [prerender-spa-plugin] Unable to prerender all...
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