-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Vuex state not loading #773
Comments
Do you have a minimal reproduction please? It's working fine in our e2e tests. |
Seeing the same issue on a project too. Can't pinpoint what is causing it, but we use a lot of dynamic Vuex modules so might be something to do with that? @alexbowers do you have any dynamic modules in your project? |
@Akryum I have rushed together an example that seems to highlight this issue (and possibly another?) It does seem to be related to dynamic modules. https://github.com/zefman/vue-devtools-demo Steps to reproduce
All of the steps above work fine without devtools open. Hope that helps 👍 |
I'm seeing the same behavior as well, I do have dynamic modules. |
I have the same issue. |
Same issue with dynamic modules. |
Same here. Edit: saw this in the console while clicking on different mutations:
|
I'm having both these problems in both Chrome (69.0.3497.100) and Firefox (v62.02) on OS X (v10.12.6). I believe I have pinpointed the area where things go wrong (at least in my code/on my system). STEPS TO REPRODUCE1) Console log after page reloadNote the 2) The same app state shown in Vue DevTools (beta v5.0.0 beta3)Note the "Recording State" message that never goes away. 3) Vue DevTools display after clicking "Load state" buttonNote, that all previous mutations of the state, is now missing. 4) Vue DevTools display after clicking "Commit This Mutation" buttonNote that state output is altered (see 'currentUser') compared to previous screen (above) 5) Finding the Culprit through the ConsoleAfter reviewing the Console output, I found that the last mutation had been called two more times with the entire state as the payload, instead of the real actual payload. SummaryI haven't had the time to investigate the DevTools code, and I don't think I would get where things go wrong within either, but I hope the above will help identify the key areas to review. The older version of Vue DevTools works fine with the same app. @siberiadev The issue with your duplicate entries, which I too had, can be solved by a bit of 'defensive' coding, and not storing the whole payload object. Example userExtraStore: (state, payload) => {
// DON'T STORE payload object
// state.authUser = payload
// INSTEAD, rewrite the object to ensure the parts you want only included.
state.authUser = {
email: payload.email,
name: payload.name,
role: payload.role,
verified: payload.verified
}
}
`` |
I have had a look into this today, and it seems as though the error occurs because registering a dynamic module doesn't cause the dev-tools to take a new snapshot of the current state. Registering a module essentially modifies the state outside of a mutation, so the replayMutations function in src/backend/vuex.js basically is out of sync, and working from state without the module. Unfortunately I can't see an easy way of hooking in to the registerModule function to trigger a new state snapshot. |
same error with dynamic register module. |
I'm also seeing this. I'm a newbie to Vue, but my app works fine until I load the vue devtools in chrome and then it seems the states are "wedged". Uninstall the vue-devtools and everything works fine again. I'm dispatching events in the created() lifecycle hook. Using a setTimeout inside the created() callback of 500 milliseconds, seem to fix the issue, but obviously it's not ideal. Example of hack below:
|
I have the same problem with Nuxt. |
same |
✋ happening with dynamic modules as well! |
Is there any news on this ? This makes developing complex apps in Vuex (with modules) almost impossible as of right now, stable dev-tools can't handle medium-sized stores and beta dev-tool don't even display stores. |
Same problem here ✋ |
I fixed that problem in #829 |
Same issue here without dynamic modules. |
I am using an old VueJs devtools chrome extension from here https://crx.dam.io/ext/nhdogjmejiglipccpnnnanhbledajbpd.html You can drag the zip in here (I had developer mode on) |
@szalapski |
I'm still getting this problem in 5.0.1. I can't seem to be able to reproduce getting stuck at Load State, but I was able to reproduce Store states showing as empty after setting values via dispatched actions. EDIT: |
Fixed and released in 5.0.3 restart chrome! |
Hi. I still have a problem similar to this using the new version pointed by @DevBrent (5.0.3). You can check using the vuex/examples repos, the shopping cart. Steps to reproduce:
This also happend in my own repo, with a different data structure of course, but getting same error, trying to commit some mutations that update an array. Any clues? |
Edit2: |
Any know of a tracking issue that is open? |
This issue was opened but fixed: #934 |
This is still an issue. Can we re-open this? |
@xaksis Please open a new issue with more details on your problem. |
I used to have the same problem, but I don't have it anymore. |
I've the same issue, the state keeps on loading and hangs, when I click on commit actions the state is empty in devtools and my app crashes with errors because the state get's altered and fucked up. Re-open |
See my previous comment. Vuex state not loading is not detailed enough. |
Restarting the browser worked for me |
I'm also experiencing the same bug on 5.0.9 😞 I just opened a new issue for this ^, hoping to get some visibility. |
Anyone else experiencing this on 5.1.0, try disabling the new Vuex backend in settings, this seems to have resolved it for me. Odd seeing that I've been using it fine up until this point. |
5.1.0 seems to have resolved this for me for now, whether or not the "new backend" is enabled. I'll come back here if the problem comes up again. |
5.1.0 works for me on Chrome, but I still have this issue on Firefox 67.0 with Dev tools 5.1.0. |
Vue.js devtools 5.1.0 dynamic modules Vuex state not loading and I also dont see the "Loading state" text |
Devtools 5.1.0 |
Devtools: 5.1.1 I got the same problem as OP, with "Clicking Export of state will give "vue_devtool_undefined" to the clipboard." I tried a different Vue project and the state loaded fine. I thought it might be a problem with my code, so I tried commenting out all Vuex modules one by one and it started working. I found the culprit was a line like:
so I replaced it with:
and now it works. It seems you can kill the Vuex devtools with a bad line of code. |
I experienced a very similar issue.
And in the
I solved it by avoiding mutations of the parameter object. (I cloned the object before mutating). Apparently, vuex keeps the reference of object, and if you try to replay it, it will use the same object. Don't mutate mutation parameters - you will have a bad time. |
Version
5.0.0-beta.3
Browser and OS info
Chrome 68.0.3440.106, Mac OS X 10.13.5
Steps to reproduce
Open an application, have some mutations happen. Inspect one and you'll see "Loading State" and it never changes.
Clicking Export of state will give
"__vue_devtool_undefined__"
to the clipboard.It is also not working when in "Recording state" and you click "Load state"
What is expected?
To view the full state at the time of the inspection.
What is actually happening?
Mutation is visible, but the state as a whole is not.
The text was updated successfully, but these errors were encountered: