Open Tcharlyson opened 3 years ago
When using store-accessor from the doc in NuxtJS,
@Action
are working until other library is used as@nuxtjs/auth-next
or@nuxtjs/i18n
then error is :Error: ERR_STORE_NOT_PROVIDED: To use getModule(), either the module should be decorated with store in decorator, i.e. @Module({store: store}) or store should be passed when calling getModule(), i.e. getModule(MyModule, this.$store)
Few workarounds exist :
- Use
@MutationAction
instead of@Action
seems to work BUT if no mutation is needed or a custom one is required, this is not a solution- Disable vuex for all third-party modules
vuex: false
BUT we loose the main purpose of using third-party modules- Import manually in all our components like
public applicationModule = getModule(ApplicationModule, this.$store)
BUT this is obviously time consumingSo how can we make
@Action
work and how do we explain that@MutationAction
is working and not@Action
?Big thanks !
@Action
is working until vuex-module-decorators:0.11.0
@Tcharlyson well, you can mutate inside the function and return a custom object?
Anyways, thanks for figuring out at least @MutationAction
works 0,o
When using store-accessor from the doc in NuxtJS,
@Action
are working until other library is used as@nuxtjs/auth-next
or@nuxtjs/i18n
then error is :Few workarounds exist :
@MutationAction
instead of@Action
seems to work BUT if no mutation is needed or a custom one is required, this is not a solutionvuex: false
BUT we loose the main purpose of using third-party modulespublic applicationModule = getModule(ApplicationModule, this.$store)
BUT this is obviously time consumingSo how can we make
@Action
work and how do we explain that@MutationAction
is working and not@Action
?Big thanks !