vuex-module-decorators: ERR_STORE_NOT_PROVIDED when used with @nuxtjs/auth
Hi,
I followed instructions for Nuxt here. When I use an action from store I’m getting ERR_STORE_NOT_PROVIDED
. I created a minimal Code Sandbox for the error.
To see follow steps below:
- Open sandbox: https://codesandbox.io/s/intelligent-tree-k1l8o
- Open console
- Click button
If I remove @nuxtjs/auth
from nuxt.config.js, it works as expected.
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 9
- Comments: 16 (1 by maintainers)
In case this helps anyone, took me a while to figure out and ended up with a working configuration.
Using
"@nuxtjs/auth": "^4.9.1",
"nuxt": "2.12.2",
and"vuex-module-decorators": "^0.16.1"
I got this working with the Nuxt typescript example (store-accessor
andinitializer
). Only difference is that I had to use a@MutationAction
. I was using a@Action
which committed amutation
and that gave me above error (the error had nothing to do with the actual problem, as it seems).Also ran into this issue today where
@nuxtjs/auth
caused a conflict. As a temporary workaround I disabled Vuex for the auth module which can be done innuxt.config.js
underauth: { vuex: false }
.Solved with the help of https://qiita.com/yoshinbo/items/70f109db7c3de4b4a99f
But seems like workaround
In documention you mentioned, to use dynamic modules you need to provide store instance. Which we can’t provide store with nuxt.js
#244 Seems to be same error.