Vue: [Vue warn]: Set operation on key "name" failed: target is readonly.
You mutated a readonly reactive object (props, readonly(), shallowReadonly, or a frozen/store state).
[Vue warn]: Set operation on key "name" failed: target is readonly.Set operation on key failed: target is readonly[Vue warn]: Delete operation on key failed: target is readonlySet operation on key "value" failed: target is readonly Meaning
Props are readonly: emit an event or copy to local state. For Pinia/Vuex store state use actions/mutations. If you called readonly(obj) intentionally, mutate the original object instead of the readonly proxy.
Common causes
- Mutating
props.user.name - Assigning to a
readonly()proxy provide(key, readonly(state))mutated in a child- Vuex strict mode
- Frozen objects
⚡ Quick fix
- Emit changes to the parent (
emit("update:user", copy)) - Copy props into local refs (
structuredClone/ref({...props.user})) - Mutate via store actions
Detailed fix by platform
Vue
const local = reactive({ ...props.user });
How to diagnose
- Target — Props/readonly?
- Mutation — Direct?
- Fix — Emit/copy?
🔧 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]: Avoid adding reactive properties to a Vue instance or its root $data at runtime Vue 2: [Vue warn]: Avoid adding reactive properties to a Vue instance or its root $data at runtime - declare it upfront in the data option
- [Vue warn]: Invalid prop: type check failed Vue: [Vue warn]: Invalid prop: type check failed for prop "count". Expected Number with value 5, got String with value "5"
- [Vue warn]: Maximum recursive updates exceeded Vue: [Vue warn]: Maximum recursive updates exceeded in component <Foo>. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself
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
- Failed to resolve component Vue: [Vue warn]: Failed to resolve component: x
- Nuxt: window/document/localStorage is not defined (SSR) Nuxt: ReferenceError: window is not defined / 500 Internal Server Error during SSR
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