8000 Allow Suppressing (Redirect) Errors in Programmatic Navigation / Navigation Guards · Issue #3329 · vuejs/vue-router · GitHub
[go: up one dir, main page]

Skip to content
Allow Suppressing (Redirect) Errors in Programmatic Navigation / Navigation Guards #3329
Closed
@j0Shi82

Description

@j0Shi82

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:

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?

What does the proposed API look like?

next({
  path: '/routeB',
  ignoreRedirectErrors: true
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0