vuex-module-decorators icon indicating copy to clipboard operation
vuex-module-decorators copied to clipboard

ERR_STORE_NOT_PROVIDED when used with @nuxtjs/auth

Open ozum opened this issue 5 years ago • 16 comments
trafficstars

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.

ozum avatar Feb 11 '20 11:02 ozum

oh god same here, any solutions?

myt588 avatar Mar 01 '20 03:03 myt588

anyone ? got solution for this

yamin90 avatar Mar 10 '20 16:03 yamin90

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: [codesandbox.io/s/intelligent-tree-k1l8o](https://codesandbox.io/s/intelligent-tree-k1l8o)

* Open console

* Click button

If I remove @nuxtjs/auth from nuxt.config.js, it works as expected.

I think this should fix your problem

https://codesandbox.io/s/competent-jang-l1f3c

championswimmer avatar Mar 10 '20 22:03 championswimmer

@championswimmer thanks for the response.

  1. What did you change?
  2. I see button now, but after I click the button, I'm geting error again:

image

ozum avatar Mar 11 '20 06:03 ozum

I think this should fix your problem

https://codesandbox.io/s/competent-jang-l1f3c

This doesn't load for me, I just recieve the following error.

NuxtServerError
Store not provided in decorator options when using dynamic option

duckies avatar Mar 16 '20 20:03 duckies

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: [codesandbox.io/s/intelligent-tree-k1l8o](https://codesandbox.io/s/intelligent-tree-k1l8o)

* Open console

* Click button

If I remove @nuxtjs/auth from nuxt.config.js, it works as expected.

I think this should fix your problem

https://codesandbox.io/s/competent-jang-l1f3c

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.

MuhammedKpln avatar Mar 24 '20 18:03 MuhammedKpln

Also having this issue. Would be worth documenting.

t-eckert avatar Apr 12 '20 06:04 t-eckert

same issue. Has anyone been able to solve it?

mb6792 avatar Apr 14 '20 08:04 mb6792

Same issue. Has anyone been able to solve it?

buuum avatar Apr 18 '20 17:04 buuum

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 and initializer). Only difference is that I had to use a @MutationAction. I was using a @Action which committed a mutation and that gave me above error (the error had nothing to do with the actual problem, as it seems).

ralfschimmel avatar Apr 20 '20 15:04 ralfschimmel

The same issue

Grey2k avatar Apr 22 '20 22:04 Grey2k

Solved with the help of https://qiita.com/yoshinbo/items/70f109db7c3de4b4a99f

But seems like workaround

Grey2k avatar Apr 26 '20 21:04 Grey2k

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 in nuxt.config.js under auth: { vuex: false }.

m2de avatar Jun 19 '20 12:06 m2de

I have documented some approaches to find out the optimum approach in this ticket: https://github.com/sniperadmin/qms-nuxt-ts/issues/17

sniperadmin avatar Jul 07 '20 22:07 sniperadmin

Solved with the help of https://qiita.com/yoshinbo/items/70f109db7c3de4b4a99f

But seems like workaround

I confirm it's a workaround for the moment, but it uses the NuxtJS classic mode of instantiating Vuex.
Thus it throws a deprecation warning at runtime.

Kapcash avatar Jul 09 '20 16:07 Kapcash

Any news ? Only MutationAction is working with NuxtJS using stateFactory

Tcharlyson avatar Sep 10 '21 10:09 Tcharlyson