Description
Version
2.3.0
Reproduction link
https://codepen.io/sirlancelot/pen/EmOxWZ
Steps to reproduce
Suppose you have a SPA-style app with Vue, Vuex, and Vue-Router, with a Vuex module for each page. The Vuex module gets registered during router.beforeResolve
on both server & client.
Both the server & client will render the page properly. However, when loading the page fresh in the browser, it seems that registerModule
is resetting the module's sub-state upon registration.
What is expected?
When Vuex is registering modules, it should see if that sub-state already exists in its store and use that instead of starting fresh.
What is actually happening?
It seems that the module's sub-state is getting cleared during registerModule
phase in the browser.
I hacked together the repro steps without Vue-Router because it's not strictly part of the problem. I tried to explain at what point portions of code run. Let me know if you need more explanation.