Skip to content

Rejected action throws ERR_ACTION_ACCESS_UNDEFINED #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cyberflohr opened this issue Sep 26, 2018 · 4 comments
Closed

Rejected action throws ERR_ACTION_ACCESS_UNDEFINED #26

cyberflohr opened this issue Sep 26, 2018 · 4 comments
Labels
bug Something isn't working

Comments

@cyberflohr
Copy link

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

@cyberflohr cyberflohr changed the title Reject action throws ERR_ACTION_ACCESS_UNDEFINED Rejected action throws ERR_ACTION_ACCESS_UNDEFINED Sep 26, 2018
@championswimmer championswimmer added the bug Something isn't working label Sep 28, 2018
@championswimmer
Copy link
Owner

now you can set rawError option to get your error thrown, not wrapped by the module.

@cyberflohr
Copy link
Author

works - thanks!

@bary12
Copy link

bary12 commented Sep 15, 2019

Is there a way to enable rawError: true by default without manually adding it to every action?

@Gcaufy
Copy link

Gcaufy commented Mar 9, 2020

Any reason for the option rawError.
It simply overwrite my errors, and getting me confused, and take more time to troubleshot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants