Skip to content

onReady triggers the onError callback with a redirection #3225

Closed
@posva

Description

This is a regression introduced in 3.3.0:

Given this code:

router.beforeEach((to, from, next) => {
  if (to.path === '/') next('/foo')
  else next()
})

router.onReady(() => {
console.log('good')
}, err => {
  console.log(err)
})

The initial navigation would trigger the second callback passed to onReady instead of the first one. This is because the Redirection Error is now visible instead of undefined

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions