I am new in angular. I create a project in angular "2.4.5". In my project I use signalr without problem but after upgrade angular to "~4.0.0", SignalR start fails and give me this message :
"Error: Error during negotiation request.
at Object.error (http://localhost:21755/Scripts/libs/signalr/jquery.signalR.min.js:9:4515) []
at g (http://localhost:21755/Scripts/libs/signalr/jquery.signalR.min.js:9:9724) []
at Object.error (http://localhost:21755/Scripts/libs/signalr/jquery.signalR.min.js:9:10024) []
at i (http://localhost:21755/Scripts/jquery-3.2.1.min.js:2:28017) []
at Object.fireWith [as rejectWith] (http://localhost:21755/Scripts/jquery-3.2.1.min.js:2:28783) []
at A (http://localhost:21755/Scripts/jquery-3.2.1.min.js:4:14060) []
at Function.ajax (http://localhost:21755/Scripts/jquery-3.2.1.min.js:4:13534) []
at Object.ajax (http://localhost:21755/Scripts/libs/signalr/jquery.signalR.min.js:9:16132) []
at t.fn.init.start (http://localhost:21755/Scripts/libs/signalr/jquery.signalR.min.js:9:9984) []
at a._.deferredStartHandler (http://localhost:21755/Scripts/libs/signalr/jquery.signalR.min.js:9:7271) []
at dispatch (http://localhost:21755/Scripts/jquery-3.2.1.min.js:3:10316) []
at q.handle (http://localhost:21755/Scripts/jquery-3.2.1.min.js:3:8343) []"
I checked my code and understood after remove angular zone.js SignalR starts fine.
What is problem?
Thanks a lot.
I ran into this same issue when converting from angularjs to angular 4. It turned out to be a bug in zone.js v0.8.8 (https://github.com/angular/zone.js/issues/746). Not sure if it is the same for you because I didn't have the same stack trace, but it's worth checking.
Only reason I found this zone.js issue is because I used the chrome dev tools with pause on exceptions and pause on caught exceptions options turned on and saw that there was a exception occurring in zone.js where a variable called 'originalDescGet' was undefined when the apply method was called. The error from signalr was hiding the root issue.
Updating to zone.js v0.8.9 fixed it for me. Hope this helps someone.