[socket.io.js:2887]: Error: invalid payload

Hi everyone,

I’m currently working on a personal project with socket.io, but even with the last release version (1.54.0), I have this new issue : [socket.io.js:2887]: Error: invalid payload
It happens every time without the version 1.54.0, then sometimes with the version 1.54.0 (this was yesterday and today it is every time).

I’m on macOS with Firefox 101.0.1 (on Brave macOS + on my iPhone with Chrome does not work too)

Did you get this issue with the last engine’s version ? If yes, why does it appear ?

When it tries to connect to my socket.io’s project, it adds some random numbers in the response that I don’t add from my server or my client. Examples : 0{"sid":"K2a8MaIHMYo21zk9A... , 40{"sid":"LVmMyDdTJyJTN9nsAAh-"} Which is maybe why I get this error : [socket.io.js:2887]: Error: invalid payload (sometimes I’m getting this error, sometimes not, even with the same code)

The entire error :

[socket.io.js:2887]: Error: invalid payload

decodeString@https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.4.1/socket.io.js:2887:19
add@https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.4.1/socket.io.js:2779:25
ondata@https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.4.1/socket.io.js:3982:22
Emitter.prototype.emit@https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.4.1/socket.io.js:583:22
onPacket@https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.4.1/socket.io.js:2226:20
Emitter.prototype.emit@https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.4.1/socket.io.js:583:22
onPacket@https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.4.1/socket.io.js:945:66
callback@https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.4.1/socket.io.js:1190:18
onData@https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.4.1/socket.io.js:1194:53
Emitter.prototype.emit@https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.4.1/socket.io.js:583:22
onData@https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.4.1/socket.io.js:1533:14
onLoad@https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.4.1/socket.io.js:1587:16
create/xhr.onreadystatechange@https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.4.1/socket.io.js:1486:22

NB : It works with my friends, but I’m the only one to get it

Thanks a lot for your help and have a good day :smile:,
Corentin