cemerick / austin

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

Integration with third party nrepl middleware #11

Open danielsz opened 11 years ago

danielsz commented 11 years ago

I'm not sure if this is the right place to submit this, but I'm looking for a solution to use both austin and ritz in the same project. I would like to debug server code with ritz, and work with an austin repl when developing client-side code. I'm not asking to run them at the same time, the ability to alternate between the two would be good enough. If I understand correctly, the automatic nrepl middleware injections carried by both projects don't agree somehow. This is error I get when I issue the command nrepl-ritz-jack-in in a project configured with austin, like the sample app.

WARNING] No nREPL middleware descriptor in metadata of clojure.core$comp$fn__4154@511ad529, see clojure.tools.middleware/set-descriptor![WARNING] No nREPL middleware descriptor in metadata of clojure.core$comp$fn__4154@397f0e73, see clojure.tools.middleware/set-descriptor![WARNING] No nREPL middleware descriptor in metadata of clojure.core$comp$fn__4154@448dbd82, see clojure.tools.middleware/set-descriptor!ERROR: Unhandled REPL handler exception processing message {:id 1, :op clone}

This brings up a question of nrepl middleware interplay, so I'm sorry if I inflict this issue on austin, but if anyone has a workaround, I'd love to learn about it.

cemerick commented 11 years ago

I don't currently use ritz (or emacs, which is where nrepl-ritz-jack-in comes from), so I can't test this immediately, but will return to it soon.

danielsz commented 11 years ago

Thank you, @cemerick.

If it helps, I believe you can keep emacs out of the equation. Instead of nrepl-ritz-jack-in, you can type in the root folder of a ritz and austin-enabled project, lein ritz-nreplto start the nrepl server. It will then show you the port where you can connect the client. Establishing that connection in this context is what seems to be troublesome.

cemerick commented 11 years ago

@hugoduncan, can you confirm this? I figure you're using ritz and emacs all the time, and I know you've fiddled with Austin…

hugoduncan commented 11 years ago

I reproduced using lein ritz-nrepl, and connecting via nrepl.el. Looks like piggieback is seeing a nil session. I would need to investigate further to find out how that can happen, but my current guess is that the session atom is not being passed correctly to the project classloader (via classlojure/eval).

[WARNING] No nREPL middleware descriptor in metadata of clojure.core$comp$fn__4154@3387f025, see clojure.tools.middleware/set-descriptor!ERROR: Unhandled REPL handler exception processing message {:id 1, :op clone}
java.lang.NullPointerException
    at clojure.core$deref_future.invoke(core.clj:2108)
    at clojure.core$deref.invoke(core.clj:2129)
    at cemerick.piggieback$wrap_cljs_repl$fn__4533.invoke(piggieback.clj:222)
    at clojure.tools.nrepl.middleware$wrap_conj_descriptor$fn__409.invoke(middleware.clj:17)
    at clojure.tools.nrepl.server$handle_STAR_.invoke(server.clj:18)
    at ritz.nrepl.exec$exec.invoke(exec.clj:36)
    at clojure.core$eval4568$fn__4569.invoke(NO_SOURCE_FILE:0)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at classlojure.core$eval_in_STAR_.doInvoke(core.clj:86)
    at classlojure.core$eval_in.doInvoke(core.clj:100)
    at ritz.repl_utils.classloader$eval_clojure_in.doInvoke(classloader.clj:118)
    at ritz.repl_utils.classloader$eval_clojure.doInvoke(classloader.clj:124)
    at ritz.nrepl.exec$exec_using_classloader.invoke(exec.clj:61)
deg commented 10 years ago

I just discovered ritz and am trying it out. I've hit this same problem in my projects that use Austin. So, just wondering if there's been any progress on this issue? Any help I can offer from the trenches?