Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throw proper error when aborting navigation #3113

Closed
protiumx opened this issue Jan 31, 2020 · 1 comment
Closed

Throw proper error when aborting navigation #3113

protiumx opened this issue Jan 31, 2020 · 1 comment

Comments

@protiumx
Copy link

Version

3.1.3

Reproduction link

https://codesandbox.io/s/vue-router-undefined-error-7ltnr

Steps to reproduce

  • Create route "/" and "/B"
  • Redirect to "/" inside "beforeEnter" in /"B" using next('/')
  • Push "/B" from "/"

What is expected?

To have a proper error object thrown

What is actually happening?

Undefined object thrown Uncaught (in promise) undefined


This only happens when using this.$router.push. The behaviour is not present using router-link.
Even though, I'd be great to always have proper errors. I suspect this is the line of code involved https://github.com/vuejs/vue-router/blob/dev/src/history/base.js#L163

@posva
Copy link
Member

posva commented Jan 31, 2020

See #3047

@posva posva closed this as completed Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants