-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Couldn't establish connection between socket.io client (4.2.0) to socket server(4.2.0) #1495
Comments
I wasn't able to reproduce: https://github.com/socketio/socket.io-fiddle/tree/sample-react-app Could you please check? Note: could it be a problem of |
same issue in vue 3.2 4.2 client cannot connect 4.2 server. |
It seems there is actually a problem with some bundlers (see here), I'm digging into this. |
Hi Sorry for the late reply,here is the link to my repo I made a sample app to reproduce the error |
@alpha-titan thanks! I've suggested a temporary workaround here: vitejs/vite#4798 (comment) |
Thanks @darrachequesne |
It seems vite has issues with absolute dependencies in the "browser" field, so we'll provide a quick workaround. Related: - socketio/socket.io-client#1494 - socketio/socket.io-client#1495
I had the same issue. Instead of attaching the httpServer directly via
I'm using this now:
Worked for me for some reason. Hope it helps. |
It should be fixed by this commit, included in version |
There are some bugs in the
4.2.0
client, I am not able to connect to the server.I have enabled CORS on the socket server as well as the express server
I was stuck at this issue for hours tried everything no luck establish a WebSocket connection with the server, finally downgraded to
4.1.3
To reproduce
Create a React app with Vite js
npm init vite@latest react_app
install
socket.io-client
4.2.0Create an express server running on a different
port
install
socket.io
4.2.0Client
Add the below code in
app.jsx
This exact code is working when downgrading the client socket version to
4.1.3
Server
Upon inspecting Network for ws connections
using
4.1.3
connection is createdusing
4.2.0
pendingwhen I use the
CDN
and comment out the import it works again.The text was updated successfully, but these errors were encountered: