microsoft / HoloJS

Provides a framework for creating holographic apps using JavaScript and WebGL.
MIT License
1.19k stars 113 forks source link

WebSocket support #118

Closed greenjava closed 6 years ago

greenjava commented 6 years ago

I use socket.io in my HoloJS application, but since the update of dom.js (aa614c0b043321de5d85c072daf28fe23632277b), I have an error in this file when I create a websocket :

let socket = io.connect(serverURL); generate a backtrace:

TypeError: Object doesn't support property or method 'create'
   at NodeListProxy (dom.js:8541:5)
   at wrap (dom.js:525:9)
   at getElementsByTagName (dom.js:1263:17)
   at o.prototype.doPoll (http://192.168.124.31:3000/hololens/socket.io.js:2:19349)
   at r.prototype.poll (http://192.168.124.31:3000/hololens/socket.io.js:2:5396)
   at r.prototype.doOpen (http://192.168.124.31:3000/hololens/socket.io.js:2:4896)
   at r.prototype.open (http://192.168.124.31:3000/hololens/socket.io.js:2:7443)
   at r.prototype.open (http://192.168.124.31:3000/hololens/socket.io.js:1:25414)
   at r (http://192.168.124.31:3000/hololens/socket.io.js:1:23241)
   at r (http://192.168.124.31:3000/hololens/socket.io.js:1:21530)

The Object that doesn't support method create method is Proxy (in dom.js): var p = Proxy.create(handler, idl.NodeList.prototype);

Almost-Done commented 6 years ago

Sorry for the regression. I'll take a look to see what went wrong.

Almost-Done commented 6 years ago

I created a PR (#120 ) with the fix. The socket.io chat sample seems to be working now. Please give it a try and let me know if you still encounter issues.

greenjava commented 6 years ago

Thank you very much, now it works 👍

Almost-Done commented 6 years ago

Awesome. Thank you for reporting this.