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

Wrong isLegacy checking #932

Closed
bajzarpa opened this issue Mar 27, 2019 · 1 comment
Closed

Wrong isLegacy checking #932

bajzarpa opened this issue Mar 27, 2019 · 1 comment

Comments

@bajzarpa
Copy link
Contributor

Version

5.0.3

Browser and OS info

Chrome 73, macOS 10.14.3

Steps to reproduce

Start the Vue Devtools with a 2.x version Vue and 1.x version of Vuex

What is expected?

It can map the mutations properly

What is actually happening?

Throws console errors


It looks like when you deciding is that the current Vuex is an old version you only rely on the version of Vue. In our case where the Vue is 2.x and Vuex is 1.x, it's not the best solution because when the app tries to replay the mutations it tries to use a Vuex 1.x handler.

@zfeher
Copy link

zfeher commented Mar 28, 2019

Checked this in 5.0.3:

isLegacy = hook.Vue.version && hook.Vue.version.split('.')[0] === '1'

And in initVuexBackend:

if (isLegacy) {
  // Vuex 1
  mutation.handlers(store.state, mutation.payload)
} else {
  mutation.handlers(mutation.payload)
}

Unfortunatelly this won't work with Vue 2 + Vuex < 2.x setup which some may have.

The legacy check of Vuex may need to be separated from Vue legacy checking to make this setup work.

@Akryum Akryum closed this as completed in c98770a Mar 28, 2019
simsim0709 pushed a commit to simsim0709/vue-devtools that referenced this issue May 7, 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