Skip to content

Error at redirecting throught beforeEach #2916

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

Closed
JFGHT opened this issue Sep 2, 2019 · 1 comment
Closed

Error at redirecting throught beforeEach #2916

JFGHT opened this issue Sep 2, 2019 · 1 comment

Comments

@JFGHT
Copy link

JFGHT commented Sep 2, 2019

Version

3.1.3

Reproduction link

https://github.com/JFGHT/vue-router-error-repro

Steps to reproduce

1.- Push to any route (this.$router.push('/test');).
2.- Redirect to same router but with extra param.

if (to.fullPath === '/test') {
  next('/en/test');
}

route:

{
  path: '/:lang?/test',
  name: 'test',
  component: () => import(/* webpackChunkName: "test" */ './views/Test.vue'),
},

What is expected?

Correct redirect.

What is actually happening?

It's redirecting but it's displaying an error:
vue-router.esm.js?8c4f:2051 Uncaught (in promise) undefined

@posva
Copy link
Member

posva commented Sep 2, 2019

See #2873 (comment)

@posva posva closed this as completed Sep 2, 2019
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