mondora / asteroid

An alternative client for a Meteor backend
MIT License
734 stars 101 forks source link

Uncaught Error: process.binding is not supported #71

Closed mkolodny closed 9 years ago

mkolodny commented 9 years ago

I'm seeing the error "Uncaught Error: process.binding is not supported" when attempting to require 'asteroid' using browserify.

It appears that the problem is in faye-websocket. Browserify uses the process package to mimic to Node's built-in process module. The process module doesn't shim the binding method, which is causing the error I'm seeing. This issue goes away when I replace faye-websocket with the websocket package.

I'm going to submit a pull request that uses the more popular websocket package instead of faye-websocket.

mkolodny commented 9 years ago

I'm now seeing the error TypeError: this._SocketConstructor is not a function when requiring asteroid in my karma tests after the update. I also see this error if I use dist/asteroid.browser.js instead of dist/asteroid.node.js.

Any advice for using asteroid with karma/browserify?

mkolodny commented 9 years ago

I ended up getting this to work by installing [SockJS], and using dist/asteroid.browser.js.

MHerszak commented 8 years ago

Hi, just for future reference.. The fs module will not work on the client. You should move file access to a place that is server only. That worked for me.