Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spacebrew.js doesn't work in node #4

Open
vorg opened this issue Jul 10, 2013 · 2 comments
Open

Spacebrew.js doesn't work in node #4

vorg opened this issue Jul 10, 2013 · 2 comments

Comments

@vorg
Copy link

vorg commented Jul 10, 2013

Beside checking for node environment, module exports and using wc node module the spacebrew.js 1.3.0 doesn't work in node.

#140 - you use window without checking if it's defined (it's not in node)
this.debug = (window.getQueryString('debug') === "true" ? true : (options.debug || false));

#226 - you use browser style this.socket.onopen handlers while ws module requires this.socket.on('open'...

I fixed all that successfully published client on the cloud and then failed because of SyntaxError: Unexpected token u error in incoming message.

Are there plans to officially support node / Plask apps?

@vorg
Copy link
Author

vorg commented Jul 10, 2013

Ok, just fixed it by changing #408 var data = JSON.parse(e.data) to var data = JSON.parse(e)

@julioterra
Copy link
Member

Thanks for catching these issues. We hadn't tested the latest version of the .js library with node, which is probably why these issues crept in. We'll make sure to merge these updates back into the main repo after testing to make sure they don't break the lib on the browser. We'll also make an effort to test the library more thoroughly in future releases.

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

No branches or pull requests

2 participants