-
Notifications
You must be signed in to change notification settings - Fork 297
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
[BUG]: Failed to execute 'send' on 'WebSocket': Still in CONNECTING state. #596
Comments
Hey @devanshkansagra, this is the issue i was talking about, any help from your side will be greatly appreciated. |
Yea sure I will be working on it |
Let me also explain when we call the connect function defined in |
hey @devanshkansagra are you working on this? If not, I'm willing to fix it. |
hey @r3yc0n1c, you can try it, but I don't think this is currently solvable because on integration side you are using react18 and in the storybook react17 is used so might be due to react versioning this is causing error. This thing we(I and @Spiral-Memory) have came across when I was working on this issue. The ddp error #600 is actually solved but this websocket still in connecting state error is not solved. This might be due to poor state management or something else causing in the backend side. |
have you tried upgrading storybook to react18 or downgrading the integration side? |
Actually I have tried to upgrade it but still I have got same error. Idk whether this is backend side or client side issue |
On downgrading the integration this error is resolved |
maybe I don't know but when this project was introduced the react17 was very stable and react18 was a new commer. and earlier the integration was done on v17. we have some integration examples like e2e-react package, it is working on react 18 and you will observe this error over there |
got it, let me try this for v18 |
Hey @r3yc0n1c check this I am running this e2e-react package which is an EmbeddedChat integration and still there is error when running on react18 |
Description
If you try to integrate this
EmbeddedChat
package into a React application created usingcreate-react-app
, as soon as you log in, you will encounter a warning or error similar to this:A similar issue can also be found sometimes while in development, such as when Storybook hot reloads. Open the console log, and try to trigger actions like clicking on the page or typing something. You will notice a console error related to DDP:
The problem most likely lies in the connect function of the app in the
EmbeddedChatAPI
file. In the connect function, afterconnect({})
has been called, we call the resume function and pass the token. It seems like the connect function needs some time to establish the connection, and only after the connection is successfully established should other real-time DDP methods be called. If you comment out the section of code afterconnect({})
, things will start working fine. I have been seeing this issue for a long time, since January when I first started contributing, but I don't know how to fix it.Any help from other contributors would be really helpful.
Expected behavior
Real-time communication should be initiated only after a successful connection is made.
Update: As a temporary solution, Use "react": "^17.0.2" and "react-dom": "^17.0.2" in your project to avoid encountering this error during integration.
The text was updated successfully, but these errors were encountered: