Need help with an error from engine.io-client when closing the connection #4913
-
So I have a FiveM server running socket.io, whenever I close the connection with the socket.io client, the FXServer window returns an error, displayed in the attached screenshot. I have tried to debug this error, but I haven't found much aside from that the error comes from line 599 in the onClose function of socket.js in engine.io-client, but after debugging it shows that the error actually comes from a few lines above it, line 587 calls removeEventListener for the beforeunload event with this.beforeunloadEventListener attached, after logging in the citizen folder, I have found that the attached event listener is undefined and that causes the error. I have no idea now why the error is caused and how to fix this and if this is even an issue with my server or not. To reproduce this error I closed the socket connection manually after it connected with the FXServer. This isn't a big issue as well, but I can't stand there being an error. Thank you for the help in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
It seems to come from those lines: https://github.com/socketio/engine.io-client/blob/fa479164251dd1f283dd163143b546582161339a/lib/socket.ts#L944-L948 The |
Beta Was this translation helpful? Give feedback.
It seems to come from those lines: https://github.com/socketio/engine.io-client/blob/fa479164251dd1f283dd163143b546582161339a/lib/socket.ts#L944-L948
The
this.beforeunloadEventListener
is undefined, hence the error I think. The other browser engines seems to tolerate passing anundefined
value instead of a proper function, but not in your case.