Changing login path URL results in Error: ERR_ACTION_ACCESS_UNDEFINED
I'm submitting a
bug report,
Current behavior
changing users.ts from
export const login = (data: any) =>
request({
url: '/users/login',
method: 'post',
data
})
to:
export const login = (data: any) =>
request({
url: '/auth/identity/callback',
method: 'post',
data
})
Expected behavior
Just changing the url path should not result in an error. I'm using this in conjunction with another change to connect to my development server for login:
.env.development:
# Base api
VUE_APP_BASE_API = 'http://localhost:4000/api/'
Minimal reproduction of the problem with instructions
see Current Behavior
What is the motivation / use case for changing the behavior
I want to authenticate a user from a locally-running development server which will return a JWT.
Environment
mac os X catalina, firefox
full error:
Error: 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"]
action/</<@webpack-internal:///./node_modules/vuex-module-decorators/dist/esm/index.js:334:37
step@webpack-internal:///./node_modules/vuex-module-decorators/dist/esm/index.js:114:23
verb/<@webpack-internal:///./node_modules/vuex-module-decorators/dist/esm/index.js:95:53
rejected@webpack-internal:///./node_modules/vuex-module-decorators/dist/esm/index.js:86:57
createError@webpack-internal:///./node_modules/axios/lib/core/createError.js:16:15
settle@webpack-internal:///./node_modules/axios/lib/core/settle.js:17:12
handleLoad@webpack-internal:///./node_modules/axios/lib/adapters/xhr.js:59:13
这看起来像是一个bug,vuex-module-decorator 默认会包装 module 里的错误,把原来的错误替换掉了 https://github.com/championswimmer/vuex-module-decorators/issues/86
Thanks I see I'm missing a decorator but I don't know why. Why does changing a hard-coded string cause an error?
how to fix it? #114
I re_clone the repo and copy src to the src, it works.