Using Vuex with Nuxt and Vue-Native-Websocket
Clash Royale CLAN TAG#URR8PPP Using Vuex with Nuxt and Vue-Native-Websocket I'm trying to fill my vuex store with data from websocket. I'm using Nuxt. For handling websocket I'm using vue-native-websocket package. Connection to websocket is successful, but commiting to the store doesn't work, it fires an error on every socket event Uncaught TypeError: this.store[n] is not a function Uncaught TypeError: this.store[n] is not a function According to Nuxt and vue-native-websocket docs, I've using them as following: Plugin native-websocket.js: import Vue from 'vue' import VueNativeSock from 'vue-native-websocket' import store from '~/store' Vue.use(VueNativeSock, 'wss://dev.example.com/websocket/ws/connect', { store: store }) nuxt.config.js plugins: [ {src: '~plugins/native-websocket.js', ssr: false} ], As the connection is established, I draw a conclusion that the package is connected right, so it's something about store