danielroe / typed-vuex

đŸĻ A typed store accessor for vanilla Vuex.
https://typed-vuex.roe.dev
MIT License
353 stars 27 forks source link

fix: devtools does not show auth module #108

Open MrJmpl3 opened 4 years ago

MrJmpl3 commented 4 years ago

🐛 The bug Nuxt Auth cannot register a module in store, look the devtools

🛠ī¸ To reproduce https://codesandbox.io/s/distracted-platform-hw4xe

🌈 Expected behaviour Nuxt Auth can register a module for authentification.

ℹī¸ Additional context Nothing

danielroe commented 4 years ago

@MrJmpl3 I think this may be related to #39. The auth module is being correctly registered, it's just not showing up in the devtools. If you click on a component in the devtools Component mode (first tab), and then switch to console, you can verify this:

console.dir($vm0.$store.state.auth)
// loggedIn: false
​// strategy: "local"
​// user: null

Unfortunately, I believe this to be a bug in the devtools as nuxt-typed-vuex doesn't change, modify or interfere with the Vue store at all (or in other libraries' access to the store) - it only provides an accessor to it.

ShaggyTech commented 4 years ago

Edit 12/17/2020: The method described below is no longer working for me and the bug has returned.


Left the same comment in the other issue but this is how I managed to fix it:

I was having a similar issue with the store state not getting updated in vue dev tools. I managed to fix this by doing the following:

  1. In the Vue Dev Tools tab, click on the Settings icon.
  2. Check the box to enable New Vuex Backend.
  3. After restarting the browser, vuex state should now work as designed.
MrJmpl3 commented 4 years ago

I do @ShaggyTech fix in the example, but auth module registration and store of auth module don't show đŸ˜ĸ

avxkim commented 4 years ago

@MrJmpl3 i had enabled New Vuex Backend already, but it's not updating for me either.

@danielroe does it work for you?

avxkim commented 4 years ago

Also there's similar behavior, when you rehydrate state from a localstorage with this package: https://github.com/robinvdvleuten/vuex-persistedstate

In a console i see, it's rehydrated, but not in devtools. @danielroe is it on the devtools side problem? Can we report it?

danielroe commented 4 years ago

@webcoderkz Yes, I believe this is a bug with devtools.