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

Separate instances of Vuex store clash each other when working across separate Vue instances #1462

guywithdoubts opened this Issue Nov 28, 2018 · 1 comment


None yet
2 participants

guywithdoubts commented Nov 28, 2018



Reproduction link

Steps to reproduce

I am currently learning/prototyping vue.js and vuex (using plain js, at the moment). I am trying to accomplish following:

1)create multiple vue instances having their own vuex stores independent to each other. Right now, I am storing only ajax status/progress in vuex store and improve it gradually.
2)vue instances can come from same vue definition (template, methods etc.), but need to work with different vuex store instances.
3)vuex stores should not know about each other (no clashes) and should only work exclusively with their respective vue instance counter parts.

I almost achieved the above as shown in fiddle:

Theoritically, we can just create one class out of app.js and app2.js (identical code). But, just to test/troubleshoot things, I separated them.

I am able to pull data and everything seems working fine. If I refresh button in second instance the console log shows perfectly. If I refresh button in first instance it clashes with the vuex store in second instance

What is expected?

the vue instance should not clash with other vuex stores not related to it

What is actually happening?

first vue instance clashes with vuex store in second instance

more information here:


This comment has been minimized.


ktsn commented Dec 2, 2018

Because you are registering your two TodosList components to the exact same Vue object. Even though you assign it to different variables (in your code app.Vue and app2.Vue), there are pointing the same object. Then the refresh button always call the second getTodosAsync function.

Note that you should not create multiple Vuex instance in the same page since it assumes there is only store instance. Please use module (with namespaced: true option) instead when you want to separate your state and logic.

@ktsn ktsn closed this Dec 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment