-
-
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 loads forever #967
Comments
I'm also experiencing this with version 5.0.9 on Firefox 66.0.3 |
Please provide a minimal runnable reproduction. |
This was happening for me but I was able to fix it. Hopefully this helps somebody. I noticed that when I would click the 'Load state' button from the Vuex tab in the Vue dev tools, I would get an error in the console. That made me realize that when you click Load state, all the getters for all the modules run, which makes sense, but one particular getter was being called and operating on un initialized state. Basically I was accessing properties on null and this stopped vue dev tools from loading the state. Once I fixed the failing code it worked. I never noticed these issues in production because all the initialization would have been set up by the time the getters were used, but the dev tools forced the getters to execute before I was expecting them to. |
Thanks for your comment @cthorne91! That was the issue for me as well 🙂 I do feel like there should be some sort of UI feedback in the Vuex pane, instead of quietly printing an error in the console. It's very easy to miss the error and waste time trying to figure out the problem. The visual feedback can be like the |
I opened a feature request issue so this problem can go through a more visible route. I'm gonna keep this issue open as well for more visibility. |
I'm also experiencing this issue on Chrome 72.0.3626.119 and macOS High Sierra v10.13.6 |
So I looked into this issue a bit more in my Vue project, and it turns out that the store load error I'm getting doesn't seem to be coming from my project at all. I'm using modules in my store, but when loading the store breaks, the error is So I went and I poked into the original issue that complained about this bug (#773), and I noticed the affected version was 5.0.0-beta.3. I poked into the release notes, and version 5.0.0 refactors vuex snapshots quite significantly. I suspected this version might've broken something, so I built an older version of Vue dev tools (4.1.5) to see if the store loads there. Sure enough, without any problems and without any changes to my project at all, the store loads fine! @Akryum I understand that having a reproduction of the issue is very helpful for troubleshooting. I tried to make a minimum runnable reproduction of this issue on latest Vue dev tools, but I couldn't get it to show up with a simple store (or even a store with modules). However, judging by the sheer number of users affected by this issue for such a long time, and that a version revert fixes the issue, we'd appreciate it if someone could take a look at this. If anyone was able to reproduce the issue on something they can post publicly, it'd be much appreciated if you could share it with us! Alternatively, if there's a way of getting around that error on >5.0.0 or that there were updates to Vuex that should be taken into account to avoid it, I'd love to hear about it 🙂 |
Hi, I opened a similar issue here : #971 . I seems that, in some cases, mutations are replayed on state loading, but their payload is altered (in my case, a geolocation.Position object). The issue contains a repo that reproduces the crash using |
Thanks for fixing the issue, much appreciated! 🎉 |
Here's the error I'm getting for 5.1.0. The odd thing is the exception is not always thrown which means it may be a timing issue? I can refresh and load state and repeat if exception until eventually it works.
Where function getNestedState (state, path) {
return path.length
? path.reduce(function (state, key) { return state[key]; }, state)
: state
} |
I’m getting a This is only in FF. Chrome works perfectly. |
Here is my trace:
EDIT: Uncheck "New vuex backend" will let me see the state. |
@samiconductor That's what is making it so hard to track down the source of the bug... it happens randomly. |
Version
5.0.9
Browser and OS info
Chrome 73 / MacOS High Sierra
Steps to reproduce
What is expected?
The Vuex state should appear in the pane.
What is actually happening?
At the bottom of the pane, the Vuex state does not appear. Instead, a message saying "Loading state..." along with a spinner appear, but that's it.
Another issue has been opened a while ago describing the same issue (#773). The thread says the problem has been fixed, but others (including myself) are still experiencing that issue.
The text was updated successfully, but these errors were encountered: