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

Route is not defined when using vuex-router-sync #797

Open
Ben52 opened this issue Oct 4, 2018 · 2 comments
Open

Route is not defined when using vuex-router-sync #797

Ben52 opened this issue Oct 4, 2018 · 2 comments
Labels
need team repro We acknowledged your report and will soon try to reproduce it

Comments

@Ben52
Copy link

Ben52 commented Oct 4, 2018

Version

5.0.0-beta.3

Browser and OS info

MacOS 10.14

Steps to reproduce

  1. Follow instructions at https://github.com/vuejs/vuex-router-sync to set up Vuex and a router and sync them
  2. In your Vuex store, add a getter method that references the route object on the state.

What is expected?

The route property on the vuex state should be the Router route object.

What is actually happening?

It is undefined


This bug does not occur with Vue devtools 4.
An example of the getter method I have that is crashing now:

inBookingView(state) {
            console.log(state.route)
            return state.route.name === 'bookings';
        }

When devtools 4 is running, the Route object is logged, with 5, it is undefined, and crashes on the next line.

@Ben52 Ben52 changed the title Router is not defined when using vuex-router-sync Route is not defined when using vuex-router-sync Oct 4, 2018
@matrunchyk
Copy link

matrunchyk commented Oct 5, 2018

Same here!
We're using vuex-router-sync too and 5.0.0 b3.

See the above for steps to reproduce. Exactly the same case.

P.S 4.1.5 beta -> no issues, works great.

@dcastil
Copy link

dcastil commented Oct 12, 2018

I had a related issue with Vuepress when using vue-devtools 5.0.0 beta 3. When visiting a new route through <router-link>, Vue was throwing errors as shown below into the console and the correspondent <Content> element didn't render.

bildschirmfoto 2018-10-12 um 23 33 09

After some time I realised the problem didn't occur when I use vue-devtools 4.1.5 beta. Seems like the dev-tools are altering the router somehow.

@Akryum Akryum added the need team repro We acknowledged your report and will soon try to reproduce it label Jan 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need team repro We acknowledged your report and will soon try to reproduce it
Projects
None yet
Development

No branches or pull requests

4 participants