Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Zone.js does not work for web sockets in Internet Explorer 11 #468

Closed
woppa684 opened this issue Sep 28, 2016 · 2 comments
Closed

Zone.js does not work for web sockets in Internet Explorer 11 #468

woppa684 opened this issue Sep 28, 2016 · 2 comments

Comments

@woppa684
Copy link
Contributor

woppa684 commented Sep 28, 2016

First of all, this is duplicate of angular/angular#10350 but I thought this location might be more appropriate. I think that a websocket message is not automatically ran in the Angular zone in internet explorer.

Run the plnkr below in chrome for example and clicking the button wil nicely increment the message. Running this in IE you will see that the update in the view lags 1 message behind (check with the message in the console). In our current applications we have to manually do a zone.run (see also the commented lines in the plnkr) to trigger change detection while in the other browsers this is not needed.

http://plnkr.co/edit/ANsjSo27QldcInUXRlV2?p=preview

@woppa684
Copy link
Contributor Author

Furthermore, if I run the web socket example from the repro in Internet Explorer 11 I get:

Secret payload not found where expected! Zones are not working! :-( <root> 

@woppa684 woppa684 changed the title Websocket messages do not trigger change detection in Internet Explorer Zone.js does not work in Internet Explorer 11 Sep 29, 2016
@woppa684 woppa684 changed the title Zone.js does not work in Internet Explorer 11 Zone.js does not work for web sockets in Internet Explorer 11 Sep 29, 2016
@woppa684
Copy link
Contributor Author

woppa684 commented Oct 6, 2016

When I add "WebSocket" to the "NO_EVENT_TARGET" array it DOES work, so:

var NO_EVENT_TARGET = 'ApplicationCache,EventSource,FileReader,InputMethodContext,MediaController,MessagePort,Node,Performance,SVGElementInstance,SharedWorker,TextTrack,TextTrackCue,TextTrackList,WebKitNamedFlow,Window,Worker,WorkerGlobalScope,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload,IDBRequest,IDBOpenDBRequest,IDBDatabase,IDBTransaction,IDBCursor,DBIndex,WebSocket'.split(',');

@vicb Could this be the cause? For now I will patch it like this in our zone.js so we can continue without all the extra detectChanges calls or NgZone.run's ...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant