Skip to content

Commit

Permalink
fix: catch redirection errors from router.push
Browse files Browse the repository at this point in the history
  • Loading branch information
emuvente committed Dec 3, 2021
1 parent e712d7a commit 5efd0e5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/server-entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ export default context => {
context.renderedNoscript = noscriptTemplate(config);
context.renderedExternals = `<script>(${serialize(headScript)})(window.__KV_CONFIG__);</script>`;

// set router's location
router.push(url);
// set router's location, ignoring any errors about redirection
router.push(url).catch(() => {});

// wait until router has resolved possible async hooks
return router.onReady(() => {
Expand Down

0 comments on commit 5efd0e5

Please sign in to comment.