Socket.io-client: cannot read 'sid' of undefined on linux in windows its working fine

Created on 6 Nov 2020  ·  5Comments  ·  Source: socketio/socket.io-client

Note: for support questions, please use one of these channels: stackoverflow or slack

For bug reports and feature requests for the Swift client, please open an issue there.

For bug reports and feature requests for the Java client, please open an issue there.

You want to:

  • [x] report a bug
  • [ ] request a feature

Current behaviour

What is actually happening?

Steps to reproduce (if the current behaviour is a bug)

Note: the best way (and by that we mean the only way) to get a quick answer is to provide a failing test case by forking the following fiddle.

Expected behaviour

What is expected?

Setup

  • OS:
  • browser:
  • socket.io version:

Other information (e.g. stacktraces, related issues, suggestions how to fix)

question

Most helpful comment

Thank actually vps installed latest v3 version and so i downgraded it to v2 and it just worked fine. TYSM for help.

All 5 comments

This report is rather uncomplete, but I'm having the same issue.

Check both client and server versions are the same if you're trying to connect to v3.0.0 server with an older client 2.x.x it wont work

I think you must be trying to connect to a v2 server with a v3 client, which are not compatible.

Since the v2 server doesn't send a sid in the CONNECT packet, it will throw here: https://github.com/socketio/socket.io-client/blob/3.0.0/lib/socket.ts#L227-L229

@Warrior-hound could you please confirm the analysis? Or give additional details about the error? Thanks!

Thank actually vps installed latest v3 version and so i downgraded it to v2 and it just worked fine. TYSM for help.

Ok. That seems to be the problem. I wrongly assumed that the new client was backwards compatible with Socket.io v2 server.

Was this page helpful?
0 / 5 - 0 ratings