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

NuxtJs ERR_STORE_NOT_PROVIDED

Open MuhammedKpln opened this issue 4 years ago • 13 comments

Hello i have an interesting problem while using vuex-module-decarators with nuxtjs.

So when i try to use it gives me error that store is not provided, which it is already provded. Im using exact the same code as provided in docs. Here is all files including error

MuhammedKpln avatar Mar 24 '20 15:03 MuhammedKpln

Exact same error here.

Espina2 avatar Mar 31 '20 16:03 Espina2

Well seems to be not developed anymore. Better to wait for vuejs 3..

MuhammedKpln avatar Mar 31 '20 23:03 MuhammedKpln

Maybe @nuxtjs/auth package conflict wiath vuex-module-decorators package. In my case, I used nuxt-i18n. that package used vuex. and provide toggle use vuex option. so turn off option, It works.

armadillo-dev avatar Apr 10 '20 08:04 armadillo-dev

@armadillo-dev is onto something

I'm using Vuex-ORM, which seems to be conflicting with vuex-module-decorators. What I ended up doing was swapping the order I was loading the plugins in /store/index.ts...

from: export const plugins = [initializer, VuexORM.install(database)];

to: export const plugins = [VuexORM.install(database), initializer];

then it just works as expected

(as an additional suggestion for nuxt: ensure your store filename matches the module name!)

NickToony avatar Apr 16 '20 18:04 NickToony

This seems to be a bug in the latest releases of this package, I use version ^0.10.1 and everything works perfect. In version ^0.16.1 the error is reproducible

christian-bravo7 avatar Apr 19 '20 06:04 christian-bravo7

I have the same problem with Nuxt in version ^0.16.1. Have you found any solution?

jankaderabek avatar Apr 20 '20 11:04 jankaderabek

The same error

Grey2k avatar Apr 26 '20 22:04 Grey2k

I have now hit the issue again after installing the nuxtjs/auth module.

Solution for now: I downgraded vuex-module-decorator to ^0.10.1, as suggested by christian-bravo7

This resolves the conflict and everything seems to work as before..

NickToony avatar Apr 28 '20 13:04 NickToony

I have same problem. If I remove this line, I got this error.

  • nuxt.config.js

router: { middleware: [ 'auth', ], },

or

  • XXX.vue

auth: false

daichancorgi avatar May 09 '20 07:05 daichancorgi

I have the same problem with nuxt-i18n. Any updates on how to make them work together? (Disabling vuex in nuxt-i18n is a workaround)

bernessco avatar May 18 '20 17:05 bernessco

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

@armadillo-dev

Maybe @nuxtjs/auth package conflict wiath vuex-module-decorators package. In my case, I used nuxt-i18n. that package used vuex. and provide toggle use vuex option. so turn off option, It works.

Thank you so much. Setting vuex: false in i18n plugin fixed my issue.

dantio avatar Aug 18 '22 21:08 dantio