Hi, I'm having a issue that I can't connect to my signalR server.
I'm using Electron with react (in case that matters), have installed react-signalr via npm and then downgraded the micoroft/signalr library down to version 6.0.21, as I've seen in the other issue that 7.x causes issues. Like this:
When I try to connect to my asp.net server, I'm getting the following errors:
Access to fetch at 'http://localhost:7573/electronHub/negotiate?negotiateVersion=1' from origin 'http://localhost:1212' 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'.
FetchHttpClient.js:70 POST http://localhost:7573/electronHub/negotiate?negotiateVersion=1 net::ERR_FAILEDError: Failed to complete negotiation with the server: TypeError: Failed to fetchError: Failed to start the connection: Error: Failed to complete negotiation with the server: TypeError: Failed to fetch
Error: Failed to complete negotiation with the server: TypeError: Failed to fetch
at HttpConnection._getNegotiationResponse (HttpConnection.js:255:1)
at async HttpConnection._startInternal (HttpConnection.js:168:1)
at async HttpConnection.start (HttpConnection.js:72:1)
at async HubConnection._startInternal (HubConnection.js:128:1)
at async HubConnection._startWithStateTransitions (HubConnection.js:105:1)
at async checkForStart (providerNativeFactory.js:33:1)
This origin 'http://localhost:1212/' is not allowed by your server, when you enable cors it will block requests from other origins.
However, it is not related to this package.
Hi, I'm having a issue that I can't connect to my signalR server. I'm using Electron with react (in case that matters), have installed react-signalr via npm and then downgraded the micoroft/signalr library down to version 6.0.21, as I've seen in the other issue that 7.x causes issues. Like this:
When I try to connect to my asp.net server, I'm getting the following errors:
FetchHttpClient.js:70 POST http://localhost:7573/electronHub/negotiate?negotiateVersion=1 net::ERR_FAILED
Error: Failed to complete negotiation with the server: TypeError: Failed to fetch
Error: Failed to start the connection: Error: Failed to complete negotiation with the server: TypeError: Failed to fetch
My TS code looks like this:
I've enabled CORS on the asp.net server like this:
Any idea how to solve this? SignalR in general is working fine. With files directly hosted on the server, I am able to connect.
Thanks :) Best regards Axel