michaelolof / vuex-class-component

A Type Safe Vuex Module or Store Using ES6 Classes and ES7 Decorators written in TypeScript.
217 stars 21 forks source link

Actions are not working in production (Nuxt w/ TypeScript) #44

Closed domi91c closed 5 years ago

domi91c commented 5 years ago

I'm currently using vuex-class-component in a simple Nuxt Typescript project. Everything works fine in development, but when I run npm run build; npm run start and try to call an action, nothing happens. No functionality or errors.

I'll try to find some time to setup an example repo.

SaphuA commented 5 years ago

This is probably related to the namespaces in combination with minification issue as discussed here: https://github.com/michaelolof/vuex-class-component/issues/43

domi91c commented 5 years ago

Will that workaround work in 2.0.4? I get the following error when I try to use the @Module decorator: $store.getters[(namespacedPath + ("__" + className + "_internal_getter__"))] is not a function

SaphuA commented 5 years ago

Yes that should still work. Can you provide a repro?

domi91c commented 5 years ago

I'm not sure what I was doing wrong yesterday, but I made another repo and added @Module({namespacedPath: 'auth'}) to the top of one of my modules and it's working now.

Thank you so much, was not looking forward to rewriting everything in plain Vuex.

danielroe commented 5 years ago

This is the same issue as #42, which I've just closed in favour of #43 as I think that is a better description of the underlying cause.

michaelolof commented 5 years ago

Duplicate of #43