You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Click on Navigate button. It will trigger navigation via router.push which will cause an error.
What is expected?
User gets silently redirected to location that was passed to next(...) in navigation guard.
What is actually happening?
Call to router.push throws an error, but the redirect still happens.
In my app, users that have not completed initial setup process after signup should be redirected to setup page. There is a navigation guard for this: if user has not completed setup, do a redirect. When user logs in, app redirects him to home page via router.push(). And when user has not finished setup process, this will cause an error.
This behavior seems to be introduced in 3.3.0 by this commit 4c727f9
I don't know whether this is a bug or intentional behavior. If it's intentional, why was it introduced? For me it seems counter-intuitive that a simple redirect causes an error.
The text was updated successfully, but these errors were encountered:
The Promise rejection was already there, we now have an error to give information about the rejection. Note in the codesandbox the error overlay is part of the development experience, not an actual error crashing the application.
Version
3.3.2
Reproduction link
https://codesandbox.io/s/vue-router-zb7l4
Steps to reproduce
Click on Navigate button. It will trigger navigation via
router.push
which will cause an error.What is expected?
User gets silently redirected to location that was passed to
next(...)
in navigation guard.What is actually happening?
Call to
router.push
throws an error, but the redirect still happens.In my app, users that have not completed initial setup process after signup should be redirected to setup page. There is a navigation guard for this: if user has not completed setup, do a redirect. When user logs in, app redirects him to home page via
router.push()
. And when user has not finished setup process, this will cause an error.This behavior seems to be introduced in 3.3.0 by this commit 4c727f9
I don't know whether this is a bug or intentional behavior. If it's intentional, why was it introduced? For me it seems counter-intuitive that a simple redirect causes an error.
The text was updated successfully, but these errors were encountered: