Vuex (strict mode): Error: [vuex] do not mutate vuex store state outside mutation handlers.
Store state was modified directly (in a component or action) while strict mode is on.
Error: [vuex] do not mutate vuex store state outside mutation handlers.do not mutate vuex store state outside mutation handlers[vuex] Do not mutate vuex store state outside mutation handlersVuex strict mode mutation outside handlers Meaning
Change state only inside mutations (commit). Copy state before editing (structuredClone/JSON.parse(JSON.stringify())) for local forms; v-model directly on store state triggers this — use a computed with get/set that commits. Turn off strict in production for performance.
Common causes
this.$store.state.user.name = "A"v-model="$store.state.x"- Mutating objects from state in a component
- Action mutating state directly
- Third-party code modifying store objects
⚡ Quick fix
commit("SET_NAME", value)in mutations- Computed get/set committing for
v-model - Clone before local modification
Detailed fix by platform
Vue
computed: { name: { get() { return this.$store.state.user.name }, set(v) { this.$store.commit("SET_NAME", v) } } }
How to diagnose
- Change — In mutation?
- v-model — Computed?
- Clone — Used?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- [Vue warn]: Set operation on key failed: target is readonly Vue: [Vue warn]: Set operation on key "name" failed: target is readonly.
- [vuex] unknown mutation type / unknown action type Vuex: [vuex] unknown mutation type: SET_USER / [vuex] unknown action type: fetchUser
- Avoid mutating a prop directly Vue: [Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders
Most viewed in Vue
- Property was accessed during render but is not defined Vue: [Vue warn]: Property "x" was accessed during render but is not defined on instance
- Nuxt: window/document/localStorage is not defined (SSR) Nuxt: ReferenceError: window is not defined / 500 Internal Server Error during SSR
- getActivePinia() was called but there was no active Pinia Pinia: Error: [🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
Other ways to find it
Where this error sits
Origin: On your device. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 5 Nov 2026