amark / coalesce

Communication framework for distributed JavaScript.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

/play/hello does not appear to do anything

KnowledgeGarden opened this issue · comments

Even adding console.log statements to play.js appear to do nothing.
That following npm update (required before running node init.js), then running node.js and opening /play/hello in two different browser tabs.

I was recently working on a project and I screwed up the most recent versions of Coalesce - everything is broken with it. Version 0.1.7 should work, it is what I'm using in production on other systems. So so so sorry for publishing something that was broken.

So my question winds up being: What version were you using? Thanks for making an issue! What are you working on?

Just the main build from the repo. Where would 0.1.7 be found?

Ah, if you have node installed (which I assume you do) just type "npm install coalesce@0.1.7", and try again. If that doesn't work let me know. More than happy to help.

Or, let me explain a little bit more: installing the working version of Coalesce via NPM won't contain the playground in it. So if you are unfamiliar with NPM then it won't be "as easy as typing". So what you would need to do (sorry this is all messed up, I promise it is worth it though!) is copy the "/play" folder, then in some directory do "npm install coalesce@0.1.7" which will create a "node_modules" folder with coalesce inside of it, then paste the "/play" folder inside the coalesce folder, and then run "node init.js" again as you did before.

^That is more the step by step explanation (I realized it was wrong of me to assume you knew how NPM worked in the previous comment, sorry about that!). But I'll be fixing the primary version of Coalesce such that everything works again (sorry that I broke it).

Did precisely what you say, node init.js shows this on the console:
SockJS v0.3.9 bound to "/com"
Opened hello.html in ff and in chrome.
Now, when I type in either and click enter, what I typed disappears, but nothing else happens.
I modified hello.js thus:
('hello', function(a){
console.log("bar "+a);
a.com.send({ what: "World", where: {on: 'magic'} });
and never see anything.

But, this is instructive, in Chrome's console, I saw this:
Failed to load resource: net::ERR_FILE_NOT_FOUND file:///C:/theory.js
Something about the code in hello.html?
Fiddling with that did not help.
Possible hint: I'm running on a windoz box?

Ah! Interesting... Theory must not have gotten installed (it should have). Do you see Theory in the node_modules folder corresponding to Coalesce? If it isn't there run "npm install theory".

With respect to the browser, Coalesce should be auto-loading Theory for you --- OH OH OH, I think I just noticed something, you said "file://C:/theory.js" which would suggest that you are opening the static file from the directory instead of from the localhost server. Is this correct?

From this hunch, what you need to do is run "node init.js" in the Coalesce directory. This should start the nodejs Coalesce server on http://localhost:8888/ . Then you load "/play/hello.html" from the server (not the file system) at "http://localhost:8888/play/hello.html". Then everything should be working - the realtime system (and Theory) will load. (If you load the /play/hello.html from the file system, the page has no way of communicating in realtime since it doesn't have a server! So you need the server).

:( things should be WAY easier than this, my whole goal of Coalesce is to make things easy, I deeply apologize - I will make this easier in the future versions. I have windows too (and linux), and I have tested 0.1.7 to work with windows, thanks for specifying that though!

@amark you do a LOT of apologizing, but you don't have to. When you submit a pull request to make this fix, please tag us. Thanks!

@amark, many lights came one here. Firstly, dopey me. I was booting the html file alone, not from the server. It's working fine now, except it's on 7777, not 8888.
Still, it's way cool! Many thanks!

@KnowledgeGarden Yay! Glad to hear it is working now!
@jtenner thanks, will do.
I'm here in the meanwhile if any of you need help.