]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
fix(ssr): reject unfinished initial navigation
authorEduardo San Martin Morote <posva13@gmail.com>
Mon, 28 Feb 2022 13:54:07 +0000 (14:54 +0100)
committerEduardo San Martin Morote <posva13@gmail.com>
Mon, 28 Feb 2022 13:54:07 +0000 (14:54 +0100)
Fix #1305

src/router.ts

index da3170c5f08073a148eb8f9c894f1a422c7540f1..90ddeef30ae00ced009d0acdd3522d46fd36d80c 100644 (file)
@@ -682,7 +682,10 @@ export function createRouter(options: RouterOptions): Router {
     return (failure ? Promise.resolve(failure) : navigate(toLocation, from))
       .catch((error: NavigationFailure | NavigationRedirectError) =>
         isNavigationFailure(error)
-          ? error
+          ? // navigation redirects still mark the router as ready
+            isNavigationFailure(error, ErrorTypes.NAVIGATION_GUARD_REDIRECT)
+            ? error
+            : markAsReady(error) // also returns the error
           : // reject any unknown error
             triggerError(error, toLocation, from)
       )