Closed Alexei000 closed 6 years ago
Versions of Server-Side NuGet Packages: Microsoft.AspNetCore.SignalR version 1.0.0-alpha2-final Versions of Client-Side NuGet/NPM Packages: "@aspnet/signalr": "^1.0.0-preview1-update1"
These versions are not compatible. Please update your server to 1.0.0-preview1-final
and see if the issue reproduces there.
Indeed, that was the issue. I have also noticed that on the client side@aspnet/signalr@latest
means ^1.0.0-preview1-update1
instead of ^1.0.0-preview1-final
. However, both versions seem to work just fine for my simple scenario.
Glad it worked. Gonna close this as resolved.
@Alexei000 yes, that is correct. There was a minor issue in the JavaScript client when preview1 was released and it needed to be updated, so the latest version of the JavaScript client is 1.0.0-preview1-update1
, but the server is 1.0.0-preview1-final
. These versions are completely compatible.
I have problem integrating an Angular 5 SPA with an ASP.NET Core SignalR Hub.
ASP.NET Core app info
Hosting: IIS Express 10 Package: Microsoft.AspNetCore.SignalR version 1.0.0-alpha2-final Relevant code:
Startup.cs
ChatHub.cs
I have a working client based on signalr-client-1.0.0-alpha2-final.js:
The connection is working correctly
Angular 5 application (not working)
package.json
(I have also tried with
@aspnet/signalr@1.0.0-preview1-final
)import { Component, OnInit } from '@angular/core'; import * as signalR from '@aspnet/signalr';
Relevant code:
Connection is not started. Developer Tools (Network) shows a request to
http://localhost:60431/chat/negotiate
which returns a non-JSON response. \Since I have a working client I think I am not using a correct package within Angular 5 app or the transport type is not used at all (thus, the need for negotiate).
How can I overcome this issue?
Please include as much of the following as you can in your bug report
I have problem integrating an Angular 5 SPA with an ASP.NET Core SignalR Hub.
ASP.NET Core app info
Hosting: IIS Express 10 Package: Microsoft.AspNetCore.SignalR version 1.0.0-alpha2-final Relevant code:
Startup.cs
ChatHub.cs
I have a working client based on signalr-client-1.0.0-alpha2-final.js:
The connection is working correctly
Angular 5 application (not working)
package.json
(I have also tried with
@aspnet/signalr@1.0.0-preview1-final
)import { Component, OnInit } from '@angular/core'; import * as signalR from '@aspnet/signalr';
Relevant code:
Connection is not started. Developer Tools (Network) shows a request to
http://localhost:60431/chat/negotiate
which returns a non-JSON response.Since I have a working client I think I am not using a correct package within Angular 5 app or the transport type is not used at all (thus, the need for negotiate).
How can I overcome this issue?
Thank you.
Please include as much of the following as you can in your bug report
logger
option on yourHubConnection
toLogLevel.Trace
and find the logs in the Console tab of your Browser Dev Toolsnew signalR.HubConnection(url, { logger: signalR.LogLevel.Trace })
Request URL: ws://localhost:4200/sockjs-node/023/12jswgxc/websocket Request Method: GET Status Code: 101 Switching Protocols
Request URL: http://localhost:60431/chat/negotiate Request Method: OPTIONS Status Code: 204 No Content Remote Address: [::1]:60431 Referrer Policy: no-referrer-when-downgrade
Request URL: http://localhost:60431/chat/negotiate Request Method: POST Status Code: 200 OK Remote Address: [::1]:60431 Referrer Policy: no-referrer-when-downgrade (this request returns an invalid JSON response (some default string on invalid route) and the client crushes with Error:
)
Request URL: http://localhost:4200/sockjs-node/info?t=1522913376070 Request Method: GET Status Code: 200 OK Remote Address: 127.0.0.1:4200 Referrer Policy: no-referrer-when-downgrade