koa-ws icon indicating copy to clipboard operation
koa-ws copied to clipboard

Client doesn't load/work in browser

Open gtarcea opened this issue 10 years ago • 2 comments

Hi,

The default client available at /koaws.js isn't loading in the browser due to the require statements included. It looks like the client code needs to be browserified. The browser displays an error on the first require statement (require('util')). It looks like the tests verify that the file is properly served (it is), but not that the file is something the browser will load.

This looks like a really neat project. Let me know if there is anything I can do to help.

gtarcea avatar Apr 19 '15 20:04 gtarcea

Yeah. For now you'll have to include it in your webpack bundle or browserify it yourself.

I am currently working on providing a pre-built client. Hopefully I will have it done soon!

mekwall avatar Apr 20 '15 08:04 mekwall

I include it in my webpack bundle for load the client on the browser. I have a webpack configuration, where i have the babel extension, for translate to JavaScript pure.

My problem is the next: I throw the client and I get this error in the chrome consol:

Websocket connetion to 'ws://koaws.js/' failed: Error in connection establishment: net::ERR_NAME_NOT_RESOLVERD

Any ideas?

Errandonea avatar Sep 13 '16 15:09 Errandonea