The following login action will produce "ERR_ACTION_ACCESS_UNDEFINED" exception (see callstack below). The original rejection reason is lost.
@Module({name: 'auth', namespaced: true})
export default class AuthModule extends VuexModule {
@Action
async login(payload: any): Promise<any> {
return Promise.reject('login failed');
}
}
ERR_ACTION_ACCESS_UNDEFINED: Are you trying to access this.someMutation() or this.someGetter inside an @Action?
That works only in dynamic modules.
If not dynamic use this.context.commit("mutationName", payload) and this.context.getters["getterName"]
Error: Could not perform action login
at Store.eval (webpack-internal:///./node_modules/vuex-module-decorators/dist/esm/index.js:311:33)
at step (webpack-internal:///./node_modules/vuex-module-decorators/dist/esm/index.js:96:23)
at Object.eval [as throw] (webpack-internal:///./node_modules/vuex-module-decorators/dist/esm/index.js:77:53)
at rejected (webpack-internal:///./node_modules/vuex-module-decorators/dist/esm/index.js:68:65)
undefined
now you can set rawError option to get your error thrown, not wrapped by the module.
works - thanks!
Is there a way to enable rawError: true by default without manually adding it to every action?
Any reason for the option rawError.
It simply overwrite my errors, and getting me confused, and take more time to troubleshot.
Most helpful comment
Is there a way to enable
rawError: trueby default without manually adding it to every action?