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
On SSR applications there's currently a scenario in which onReady is called too early and either the wrong route is rendered, or worse a server error is thrown (depending on your SSR code).
Here's the scenario:
User navigates to route A
route A has navigation guards that at some point call next('/routeB') to redirect
This comes with multiple issues. I have not tested it, but since route A is rendered on the server and route B is rendered on the client, you might run into hydration issues. More than that, in case route A does not match any component, the SSR might unnecessarily return an error based on how you handle routes with no matched components.
You can circumvent this issue by using the router.push API, but I guess this is not the intended way to navigate within navigation guards?
I was actually testing on the wring test and this seems to work on the latest version as the currentRoute is valid inside onReady. It might be related to some other code you have in your application. If you manage to boil it down, please open a new issue with the reproduction so I can take a look!
What problem does this feature solve?
On SSR applications there's currently a scenario in which
onReady
is called too early and either the wrong route is rendered, or worse a server error is thrown (depending on your SSR code).Here's the scenario:
onReady
triggers the onError callback with a redirection #3225), telling the SSR to render route A, the redirect never completesThis comes with multiple issues. I have not tested it, but since route A is rendered on the server and route B is rendered on the client, you might run into hydration issues. More than that, in case route A does not match any component, the SSR might unnecessarily return an error based on how you handle routes with no matched components.
You can circumvent this issue by using the
router.push
API, but I guess this is not the intended way to navigate within navigation guards?What does the proposed API look like?
The text was updated successfully, but these errors were encountered: