Hi @osyris ,
Glad to hear that the issue was resolved, based on our previous discussions, I've summed up an answer below, helping it may help others who have the same problem.
Utils.js:149 [2022-04-24T03:47:55.451Z] Error: Failed to start the connection: Error: Failed to complete negotiation with the server: Error: <!DOCTYPE html>
<pre>Cannot POST /Chat/negotiate</pre>
: Status code '404' Either this is not a SignalR endpoint or there is a proxy blocking the connection.
To above 404 error, the issue relates the HubConnection's URL, we should change the code as below:
connection = new signalR.HubConnectionBuilder()
Access to fetch at 'https://localhost:7231/Chat/negotiate?negotiateVersion=1' from
origin 'https://localhost:44476' has been blocked by CORS policy: Response to preflight
request doesn't pass access control check: The value of the 'Access-Control-Allow-Origin'
header in the response must not be the wildcard '' when the request's credentials mode is 'include'.*
To the above error, since the
https://localhost:44476 origin was not added in the
WithOrigins method, so it will show this CORS error.
The value of the 'Access-Control-Allow-Origin'
header in the response must not be the wildcard '*' when the request's credentials mode is 'include'.
And to the above error, since when we use the
AllowAnyOrigin method, it will add a
'*' at the request header, so to solve the above issue, we need to remove the
After modified the result should like this:
builder.WithOrigins("https://localhost:44376", "https://localhost:44476", "https://localhost:7231")
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.