# Vuex: [vuex] unknown mutation type: SET_USER / [vuex] unknown action type: fetchUser

**Code:** `[vuex] unknown mutation type / unknown action type` · **Category:** Vue · **Seen on:** Vue

`commit`/`dispatch` was called with a name that isn't registered in the store (or its module namespace).

## Meaning

Check the exact name, module namespacing (`user/SET_USER` when `namespaced: true`), that the module is registered, and typos. In components `mapMutations("user", [...])` helps. Vuex 3/4 is legacy; Pinia is the recommended store.

## Common causes

- Typo in mutation/action name
- Namespaced module needs `module/name`
- Module not registered
- Calling mutation via dispatch (or reverse)
- Hot-reload dropping modules

## Quick fix

1. Use `store.commit("user/SET_USER", payload)` for namespaced modules
2. Register modules in `new Vuex.Store({ modules: { user } })`
3. Verify names with Vue devtools

## Detailed fix by platform

### Vue

1. `this.$store.commit("user/SET_USER", user)`

## How to diagnose

1. **Name** — Exact?
2. **Namespace** — Prefixed?
3. **Module** — Registered?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/vue/vuex-unknown-mutation-type)
