PatrickJS / angular-websocket

:arrow_upper_left: The missing Angular WebSocket module for connecting client applications to servers by @AngularClass
https://angularclass.github.io/angular-websocket
MIT License
1.22k stars 194 forks source link

angular.js:13642 TypeError: Cannot read property 'readyState' of undefined #123

Open argh opened 7 years ago

argh commented 7 years ago

In my server code, I was starting to write code to reject requests that don't pass the correct URL (in the node-ws shouldHandle(request) handler). My client was still requesting a connection to "/", which reliably triggers a crash:

angular.js:13642 TypeError: Cannot read property 'readyState' of undefined
    at $WebSocket.get (angular-websocket.js:374)
    at $WebSocket.send (angular-websocket.js:296)
    at MessageService.send (message-service.js:45)
    at m.$scope.send (conversation-directive.js:204)
    at fn (eval at compile (angular.js:14539), <anonymous>:4:203)
    at b (angular.js:15628)
    at e (angular.js:25172)
    at m.$eval (angular.js:17378)
    at m.$apply (angular.js:17478)
    at HTMLButtonElement.<anonymous> (angular.js:25177)