'error calling Action in store with nuxt-socket.io err_action_access_undefined

I'm having problems calling actions in the store when I configure the nuxt-socket.io in the project, I'm configuring the nuxt-socket.io in the nuxt.config.js and calling the connection in the component according to the nuxt-socket.io documentation ( https://nuxt-socket-io.netlify.app/usage ), but when this configuration is performed, the components can no longer call the actions of the store.

I'm using vuex and vuex-module-decorators.

Config nuxt.config.js:

io: {
    sockets: [
        {
            name: 'home',
            url: 'http://url-server-backend.com',
            default: true,
        }
    ]
},

Config component:

async beforeMount(){
    const token = this.$cookies.get('authToken');
    this.socket = this.$nuxtSocket({
        name: 'home',
        channel: '/socket-io',
        persist: true,
        teardown: true,
        reconnection: false,
        extraHeaders: {
            Authorization: token
        }
    });
},

Error:

Image Error action



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source