cemerick / austin

The ClojureScript browser-REPL rebuilt stronger, faster, easier.
510 stars 31 forks source link

Obscure error when PhantomJS is not installed #12

Closed deg closed 11 years ago

deg commented 11 years ago

The repl gives a thoroughly obscure error when PhantomJS has not been installed:

(cemerick.austin.repls/exec)
Browser-REPL ready @ http://localhost:43505/2789/repl/start

IOException error=2, No such file or directory  java.lang.UNIXProcess.forkAndExec (UNIXProcess.java:-2)

The readme does already have enough hints to realize what the problem was, but I suggest adding a few more lines of setup instructions.

cemerick commented 11 years ago

Agreed. Printing a helpful message before rethrowing any IOException thrown when exec-ing the external process would be good. That's an easy patch if anyone's interested. ;-)

deg commented 11 years ago

Ok. I'll take a look at this in a couple of days, if no one beats me to it.

deg commented 11 years ago

Later: I can't reproduce this emacs problem. When/if I can pin it down, I'll reopen in a separate issue.

Hmm, so I figured I should get my project working with Austin and understand the Austin code a bit better, before I started blindly patching. I've hit a problem that's probably outside the scope of Austin code, and is definitely still outside my comfort zone. So, figured I'd check if this is a known problem before I dive further down the rabbit hole. Basically the problem is that I can't get the browser-connected REPL to work from within emacs nrepl. I can reproduce the problem in your sample app too:

;;; In Emacs: m-x nrepl-jack-in
; nREPL 0.1.8-preview
user>
;;; m-x nrepl-set-ns
#<Namespace cemerick.austin.bcrepl-sample>
cemerick.austin.bcrepl-sample> (run)
#<Server org.eclipse.jetty.server.Server@d60b23>
cemerick.austin.bcrepl-sample> (def repl-env (reset! cemerick.austin.repls/browser-repl-env (cemerick.austin/repl-env)))
Browser-REPL ready @ http://localhost:46195/1929/repl/start
#'cemerick.austin.bcrepl-sample/repl-env
cemerick.austin.bcrepl-sample> (cemerick.austin.repls/cljs-repl repl-env)
Type `:cljs/quit` to stop the ClojureScript REPL
nil
;;; browse to http://localhost:8080/
cljs.user> 5
;;; No response. repl is frozen until I abort the evaluation (m-x nrepl-interrupt)

And, all works fine when I do the same actions from a lein repl (in a vanilla shell, not in emacs). Have I hit an unsupported or untested style of use, or am I just doing something wrong?

cemerick commented 11 years ago

Fixed on gh-13.