probil/vue-socket.io-extended

Connection Closed: 1005

sb2050 opened this issue · 4 comments

I always get the message: "Connection Closed: 1005".
Can anyone tell me what is causing this?

Firefox:
https://imgur.com/VWfs8Xm
https://imgur.com/Q8As02Z

I have included the extension as follows:
VueApp:
mainjs:

import VueSocketIOExt from 'vue-socket.io-extended';
import { io } from 'socket.io-client';

const socket = io(store.getters.env.api.url);

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

App.vue:

export default {
  sockets: {
    connect() {
      console.log('socket connected');
    },
    customEmit(val) {
      console.log('this method was fired by the socket server. eg: io.emit("customEmit", data)');
    },
  },
}

Which version of socket.io-client your are using?
Which version of socket.io your server is using?

socket.io-client: ^3.1.0
socket.io srver: ^3.1.0

Honestly speaking the library haven't been tested with v3 of socket.io. They did some breaking changes which might have influenced the library. If you don't use any functionality specific to v3 just roll back to v2. It was stable for years so should work well for you. In the meantime I'll try to build a simple server with v3 to find out what has changed

Thanks for reporting @sb2050

I've build the server with socket.io v3 - works perfectly fine. Moreover, recently released socket.io v4 also works without any issues and changes in the code. Your issue might not be related to the version of socket.io 🤔

According to MDN: Connection Closed: 1005 mean:

Indicates that no status code was provided even though one was expected.

I don't really know what might cause this. Probably something on socket.io side. Anyway there is retry strategy built-in so it shouldn't be a problem.

Please create a new issue and mention this one if you still have aforementioned problem and can provide some extra details.