-
Notifications
You must be signed in to change notification settings - Fork 445
Issue in Transport.js with WebSocket.OPEN readyState #1014
Comments
Do you know if your application is using WebSockets provided by the browser? What I found for instance is that angular-cli may polyfill XmlHttpRequest which can cause issues, so I am wondering if something similar is happening here. Can you provide a repro for investigation? |
At first I tried to setup a new Angular .net Core project with only SignalR added to it, But to my surprise that worked perfectly. So the only other issue that was left was, like you said, some sort of a polyfill causing this. In my original project I added a template that comes with all sorts of JS plugins, including I've added the following code before I load
source: CodeByZach/pace#305 And it now works fine. So this wasn't an issue with SignalR after all. Thanks for the prompt response and pointing me in the right direction! |
@chinookproject you saved my day THANKS ! 💃 |
@chinookproject
|
Had the same issue, removing pace.js solved the problem |
Same issue, removing pace.js solved. |
So if removing pacejs solves the problem, so what to do if we want to use it ?? -_- |
@BoubakrEchieb Try this:
This assumes your hub endpoints are Worked for me with browserlink and socket.io (feel free to remove those) |
I love you man!!! |
I have a strange issue when trying to connect to my hub in JS code. I have the following code (Angular project):
But whenever I launch the web page I get the following error back in console:
Error while establishing connection: WebSocket is not in the OPEN state
After some debugging in both my JS code en C# code I decided to check what was going on in
Transport.js
. The file that throws the above error. By default it does this:When I added a few
console.log
lines, then I get the following, with output:So as you can see
this.webSocket.readyState
outputs1
, which should be equal to:WebSocket.OPEN
. But for some reason its not.When I change the
if
statement to match against just1
, then it all works fine. Then I can send data to the C# code without any problems.(changed if statement)
Any idea what the issue could be? Is it me, or is the code in
Transport.js
not right?Additional info:
Nuget:
NPM:
"@aspnet/signalr-client": "^1.0.0-alpha2-final"
Browser chrome
The text was updated successfully, but these errors were encountered: