Vuex "typeError cannot set property 'number' of undefined"

Hi guys i am new to Vue, i created a custom attribute on okta. I want to set it to the store upon user login
to make it accessible to all my components but i’m not able to do that.

const store = new Vuex.Store({
    state: {
        number: null
    mutations: {
        setNumber({state, data}) {
            state.number = data
            console.log('data value: ', state.number)
    actions: {
        async addData({commit}) {
             let data = await Vue.prototype.$auth.getUser();
            commit('setNumber', data.number)
    getters: {
        getNumber(state) {
            return state.number;

export default store;


new Vue({
  async mounted(){
    await this.$store.dispatch('addData')
  render: h => h(App),

Error in mounted hook (Promise/async):
“TypeError: Cannot set property ‘number’ of undefined”

Please, what am i doing wrong?

setNumber(state, data)

@CaiPeng1989 thanks it works