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

Connection to clojurescript repl times out #158

Closed
minasmart opened this issue May 31, 2014 · 11 comments
Closed

Connection to clojurescript repl times out #158

minasmart opened this issue May 31, 2014 · 11 comments

Comments

@minasmart
Copy link

Hey there!

I've added [com.cemerick/piggieback "0.1.3"] to the project deps, as well as repl-options: :repl-options {:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]},

But after starting a repl with lein trampoline cljsbuild repl-listen, and issueing a :Connect command inside vim, vim just hangs. No connection ever occurs. Am I missing something?

@tpope
Copy link
Owner

tpope commented May 31, 2014

Does lein trampoline cljsbuild repl-listen give you a vanilla Clojure nREPL server or something else?

@minasmart
Copy link
Author

Turns out it doesn't! lein repl wasn't working before. After a bunch of stops and starts, lein repl seems to be working, as far as vim is concerned. However, in the terminal where I've started the repl, whenever I do documentation lookup, the repl itself errors out:

java.lang.NullPointerException
        at clojure.core$complement$fn__4048.invoke(core.clj:1357)
        at clojure.core$filter$fn__4226.invoke(core.clj:2529)
        at clojure.lang.LazySeq.sval(LazySeq.java:42)
        at clojure.lang.LazySeq.seq(LazySeq.java:60)
        at clojure.lang.RT.seq(RT.java:484)
        at clojure.core$seq.invoke(core.clj:133)
        at clojure.core$map$fn__4207.invoke(core.clj:2479)
        at clojure.lang.LazySeq.sval(LazySeq.java:42)
        at clojure.lang.LazySeq.seq(LazySeq.java:60)
        at clojure.lang.RT.seq(RT.java:484)
        at clojure.core$seq.invoke(core.clj:133)
        at clojure.core$filter$fn__4226.invoke(core.clj:2523)
        at clojure.lang.LazySeq.sval(LazySeq.java:42)
        at clojure.lang.LazySeq.seq(LazySeq.java:60)
        at clojure.lang.RT.seq(RT.java:484)
        at clojure.core$seq.invoke(core.clj:133)
        at clojure.core$set.invoke(core.clj:3712)
        at cljs.closure$cljs_dependencies.invoke(closure.clj:666)
        at cljs.closure$add_dependencies.doInvoke(closure.clj:692)
        at clojure.lang.RestFn.invoke(RestFn.java:423)
        at cljs.repl$load_namespace.invoke(repl.clj:51)
        at cljs.repl$load_dependencies.invoke(repl.clj:61)
        at cljs.repl$evaluate_form.invoke(repl.clj:110)
        at cljs.repl$evaluate_form.invoke(repl.clj:78)
        at cljs.repl$load_stream.invoke(repl.clj:131)
        at cljs.repl$load_file.invoke(repl.clj:138)
        at cljs.repl.rhino$rhino_setup.invoke(rhino.clj:99)
        at cljs.repl.rhino.RhinoEnv._setup(rhino.clj:116)
        at cemerick.piggieback$setup_rhino_env.invoke(piggieback.clj:149)
        at cemerick.piggieback$cljs_repl$fn__4417.invoke(piggieback.clj:187)
        at cemerick.piggieback$cljs_repl.doInvoke(piggieback.clj:184)
        at clojure.lang.RestFn.invoke(RestFn.java:397)
        at user$eval6464.invoke(form-init5377882624457299701.clj:1)
        at clojure.lang.Compiler.eval(Compiler.java:6619)
        at clojure.lang.Compiler.eval(Compiler.java:6582)
        at clojure.core$eval.invoke(core.clj:2852)
        at clojure.main$repl$read_eval_print__6588$fn__6591.invoke(main.clj:259)
        at clojure.main$repl$read_eval_print__6588.invoke(main.clj:259)
        at clojure.main$repl$fn__6597.invoke(main.clj:277)
        at clojure.main$repl.doInvoke(main.clj:277)
        at clojure.lang.RestFn.invoke(RestFn.java:1096)
        at clojure.tools.nrepl.middleware.interruptible_eval$evaluate$fn__591.invoke(interruptible_eval.clj:56)
        at clojure.lang.AFn.applyToHelper(AFn.java:159)
        at clojure.lang.AFn.applyTo(AFn.java:151)
        at clojure.core$apply.invoke(core.clj:617)
        at clojure.core$with_bindings_STAR_.doInvoke(core.clj:1788)
        at clojure.lang.RestFn.invoke(RestFn.java:425)
        at clojure.tools.nrepl.middleware.interruptible_eval$evaluate.invoke(interruptible_eval.clj:41)
        at clojure.tools.nrepl.middleware.interruptible_eval$interruptible_eval$fn__632$fn__635.invoke(interruptible_eval.clj:171)
        at clojure.core$comp$fn__4154.invoke(core.clj:2330)
        at clojure.tools.nrepl.middleware.interruptible_eval$run_next$fn__625.invoke(interruptible_eval.clj:138)
        at clojure.lang.AFn.run(AFn.java:24)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:744)

What's the typical workflow for starting up a repl through fireplace?

@tpope
Copy link
Owner

tpope commented Jun 1, 2014

Do you have cider-nrepl installed?

@minasmart
Copy link
Author

I do have [cider/cider-nrepl "0.7.0-SNAMPSHOT"] in my ~/.lein/profiles.clj

@venantius
Copy link

Is that really supposed to say SNAMPSHOT?

@minasmart
Copy link
Author

Nope. That was just me transcribing it wrong here. It says SNAPSHOT in the profiles.clj file

@tpope
Copy link
Owner

tpope commented Jun 7, 2014

In that case if the repl itself is erroring it's probably a bug in cider-nrepl. Confirmation would require invoking the info op directly to see if you can reproduce. Something like echo fireplace#message({'op': 'info', 'symbol': 'foo'}) might work.

@minasmart
Copy link
Author

alright, so on a new repl, with vim started up, issueing that command results in the following in the repl session:

java.lang.NullPointerException
        at clojure.core$complement$fn__4048.invoke(core.clj:1357)
        at clojure.core$filter$fn__4226.invoke(core.clj:2529)
        at clojure.lang.LazySeq.sval(LazySeq.java:42)
        at clojure.lang.LazySeq.seq(LazySeq.java:60)
        at clojure.lang.RT.seq(RT.java:484)
        at clojure.core$seq.invoke(core.clj:133)
        at clojure.core$map$fn__4207.invoke(core.clj:2479)
        at clojure.lang.LazySeq.sval(LazySeq.java:42)
        at clojure.lang.LazySeq.seq(LazySeq.java:60)
        at clojure.lang.RT.seq(RT.java:484)
        at clojure.core$seq.invoke(core.clj:133)
        at clojure.core$filter$fn__4226.invoke(core.clj:2523)
        at clojure.lang.LazySeq.sval(LazySeq.java:42)
        at clojure.lang.LazySeq.seq(LazySeq.java:60)
        at clojure.lang.RT.seq(RT.java:484)
        at clojure.core$seq.invoke(core.clj:133)
        at clojure.core$set.invoke(core.clj:3712)
        at cljs.closure$cljs_dependencies.invoke(closure.clj:666)
        at cljs.closure$add_dependencies.doInvoke(closure.clj:692)
        at clojure.lang.RestFn.invoke(RestFn.java:423)
        at cljs.repl$load_namespace.invoke(repl.clj:51)
        at cljs.repl$load_dependencies.invoke(repl.clj:61)
        at cljs.repl$evaluate_form.invoke(repl.clj:110)
        at cljs.repl$evaluate_form.invoke(repl.clj:78)
        at cljs.repl$load_stream.invoke(repl.clj:131)
        at cljs.repl$load_file.invoke(repl.clj:138)
        at cljs.repl.rhino$rhino_setup.invoke(rhino.clj:99)
        at cljs.repl.rhino.RhinoEnv._setup(rhino.clj:116)
        at cemerick.piggieback$setup_rhino_env.invoke(piggieback.clj:149)
        at cemerick.piggieback$cljs_repl$fn__4417.invoke(piggieback.clj:187)
        at cemerick.piggieback$cljs_repl.doInvoke(piggieback.clj:184)
        at clojure.lang.RestFn.invoke(RestFn.java:397)
        at user$eval6462.invoke(form-init1601395502541459694.clj:1)
        at clojure.lang.Compiler.eval(Compiler.java:6619)
        at clojure.lang.Compiler.eval(Compiler.java:6582)
        at clojure.core$eval.invoke(core.clj:2852)
        at clojure.main$repl$read_eval_print__6588$fn__6591.invoke(main.clj:259)
        at clojure.main$repl$read_eval_print__6588.invoke(main.clj:259)
        at clojure.main$repl$fn__6597.invoke(main.clj:277)
        at clojure.main$repl.doInvoke(main.clj:277)
        at clojure.lang.RestFn.invoke(RestFn.java:1096)
        at clojure.tools.nrepl.middleware.interruptible_eval$evaluate$fn__591.invoke(interruptible_eval.clj:56)
        at clojure.lang.AFn.applyToHelper(AFn.java:159)
        at clojure.lang.AFn.applyTo(AFn.java:151)
        at clojure.core$apply.invoke(core.clj:617)
        at clojure.core$with_bindings_STAR_.doInvoke(core.clj:1788)
        at clojure.lang.RestFn.invoke(RestFn.java:425)
        at clojure.tools.nrepl.middleware.interruptible_eval$evaluate.invoke(interruptible_eval.clj:41)
        at clojure.tools.nrepl.middleware.interruptible_eval$interruptible_eval$fn__632$fn__635.invoke(interruptible_eval.clj:171)
        at clojure.core$comp$fn__4154.invoke(core.clj:2330)
        at clojure.tools.nrepl.middleware.interruptible_eval$run_next$fn__625.invoke(interruptible_eval.clj:138)
        at clojure.lang.AFn.run(AFn.java:24)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:744)

Vim eventually prints a response reading:

[{'id': 'fireplace-msmart-macbook.local-1402187227-9', 'session': 'ab6c360f-7427-41d0-8338-45da6ed7d6ab', 'value': {}}, {'status': ['done'], 'id': 'fireplace-msmart-macbook.local-1402187227-9', 'session': 'ab6c360f-7427-41d0-8338-45da6ed7d6ab'}]

If I issue the echo command again with the same call, I get nothing out of the repl, and vim responds with:

[{'id': 'fireplace-msmart-macbook.local-1402187227-11', 'session': 'ab6c360f-7427-41d0-8338-45da6ed7d6ab', 'value': {}}, {'status': ['done'], 'id': 'fireplace-msmart-macbook.local-1402187227-11', 'session': 'ab6c360f-7427-41d0-8338-45da6ed7d6ab'}]

It looks like fireplace is working correctly, and that the repl has some issues, but I'm not sure. Hopefully someone here can determine that better that I can.

Thanks!

@tpope
Copy link
Owner

tpope commented Jun 10, 2014

Probably clojure-emacs/cider-nrepl#7 related.

@tpope tpope closed this as completed Jun 10, 2014
@gtrak
Copy link

gtrak commented Jun 17, 2014

You should use something like Austin or Weasel instead of running piggieback manually (I don't even remember how I did that).

@daGrevis
Copy link

I'm experiencing exactly the same situation. Using Austin instead of Piggieback helped.

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

5 participants