Closed framerate closed 5 years ago
Should work just fine.
See: https://github.com/hapijs/nes/blob/master/lib/index.js#L134
and the tests in test/client.js
Thanks @hueniverse. I'll assume maybe it's a dependency or even local env problem and I'll investigate further. Examples are definitely failing for me tonight.
I ended up forking and saw that the line you linked had WebSocket === null
. I investigated every possible problem and in the end npm install nes
was NOT installing ws
. I nuked my project and started over and it started working.
Guessing it was related to package-lock.json somehow, but if anyone else is seeing this problem just double check that node_modules/ws
exists and you should be fine. Sorry @hueniverse! Crisis averted!
This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.
Reading through docs and issues it would seem that the client is browser/node compatible, but
https://github.com/hapijs/nes/blob/819b6c402ed416de318e46f7845bee78c6b488e2/lib/client.js#L139
That line implies that when used with Node there is no WebSocket implementation?
Output when trying some of the simplest examples from the ReadMe:
I tried polyfilling a websocket lib (ws) to nes.Client.Websocket but then I just get "socket error".
I couldn't find anything in the docs or the issue tracker. I'm assuming all the users are using browser/electron (like I normally am). Is it possible to use this with Node?
Any help is appreciated and I can PR an update to the README after I figure it out. Thanks!