probil / vue-socket.io-extended

:v::zap: Socket.io bindings for Vue.js and Vuex (inspired by Vue-Socket.io)
MIT License
629 stars 38 forks source link

No errors, but no connection after upgrade #561

Open lbm-services opened 1 year ago

lbm-services commented 1 year ago

I switched my app to vite and upgraded packages. Since then I have no connection to my socket.io server. The funny thing is: if I enter a WRONG port, I see it trying to connect, with the right port (80) it simply does nothing. The problem seems to be my socket-io-actions are in a vuex store. Is there a way to use vue-socket.io-extended with Pinia?

       GET http://192.168.2.230:8080/socket.io/?EIO=4&transport=polling&t=Obylgd6 net::ERR_CONNECTION_REFUSED
       GET http://192.168.2.230:8080/socket.io/?EIO=4&transport=polling&t=Obylh0H net::ERR_CONNECTION_REFUSED
       GET http://192.168.2.230:8080/socket.io/?EIO=4&transport=polling&t=Obylhdn net::ERR_CONNECTION_REFUSED
       GET http://192.168.2.230:8080/socket.io/?EIO=4&transport=polling&t=ObyliOH net::ERR_CONNECTION_REFUSED
       GET http://192.168.2.230:8080/socket.io/?EIO=4&transport=polling&t=Obyljco net::ERR_CONNECTION_REFUSED

main.js


import VueSocketIOExt from 'vue-socket.io-extended';
import io from 'socket.io-client';
import store from './store/index.js'
var ip = '192.168.2.230';
// if on dev use ip
var host = 'http://' + (document.location.port == 5173 ? ip : document.location.host);
const socket = io(host);

Vue.use(VueSocketIOExt, socket, { store });

package versions:

├── @intlify/unplugin-vue-i18n@0.12.2 ├── @mdi/font@7.2.96 ├── @popperjs/core@2.11.8 ├── acorn@8.10.0 ├── bootstrap-vue@2.23.1 ├── bootstrap@5.3.0 ├── core-js@3.31.1 ├── eslint-plugin-vue@9.15.1 ├── eslint@8.45.0 ├── jquery@3.7.0 ├── sass@1.63.6 ├── socket.io-client@4.7.1 ├── unplugin-vue-components@0.25.1 ├── vite-plugin-vue2@2.0.3 ├── vite@4.4.4 ├── vue-i18n-bridge@9.2.2 ├── vue-i18n@8.28.2 ├── vue-router@3.6.5 ├── vue-socket.io-extended@4.2.0 ├── vue-template-compiler@2.7.14 ├── vue@2.7.14 ├── vuetify@2.7.0 └── vuex@3.6.2