TypeError: 'set' on proxy: trap returned falsish for property 'xxx' #1486
Answered
by
posva
MijikHna
asked this question in
Help and Questions
-
I am unable to access state properties from actions with this. I get always the error export const useAuthStore = defineStore("authStore", {
state: () => ({
activeUser: null as any,
logoutTimer: null as any,
isAuthenticated: false as boolean,
}),
getters: {
activeUser: (state: any) => {
return state.activeUser;
},
isAuthenticated: (state: any) => {
return state.isAuthenticated;
},
},
actions: {
updateAuth(authenticated: boolean) {
this.isAuthenticated = authenticated;
},
updateActiveUser(authUser: DecodesUserToken) {
this.activeUser = authUser;
},
},
}); If I change |
Beta Was this translation helpful? Give feedback.
Answered by
posva
Jul 27, 2022
Replies: 1 comment 2 replies
-
remove the activeUser and isAuthenticated getters, you don't need them in pinia. Normally this warns in the console as well. |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
MijikHna
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
remove the activeUser and isAuthenticated getters, you don't need them in pinia. Normally this warns in the console as well.