Fork me on GitHub
#cider
<
2019-06-15
>
ericihli04:06:51

Brand new lein new my-proj, I open project.clj and type cljr-add-project-dependency and I get the error below. Anyone have any troubleshooting ideas?

Retrieving list of available libraries...
cljr--get-error-value: Error in nrepl-refactor: java.util.concurrent.ExecutionException: java.lang.RuntimeException: Invalid token: trident/1.1

ericihli04:06:48

Whelp. Never mind. I moved to duckduckgo recently and I forgot that Google can sometimes give much better results. Found what I was looking for there. https://github.com/syl20bnr/spacemacs/issues/12385

pez09:06:58

@bozhidar, I saw that ´good-first-issue` on the repo about repl tools for cljs. I figured I wanted to give it a shot, but didn’t find any info on how to hack on cider in that readme. I can google it, of course, but is there a reason there isn’t a link in the README?

dumrat11:06:39

Hi guys, cider jack in today gives this error:

[nREPL] Starting server via /usr/local/bin/lein update-in :dependencies conj \[nrepl\ \"0.4.5\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.19.0-SNAPSHOT\"\] -- repl :headless :host localhost...
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: Exception in thread "main" java.lang.RuntimeException: Unable to resolve symbol: create in this context, compiling:(/private/var/folders/g_/ldc4hkys4r73yffyf77pcn1c0000gn/T/form-init7254150147707415858.clj:4223:33)
Any idea why this happens? Used to be fine till yesterday so I'm guessing some update somewhere?

bozhidar13:06:34

@pez I just assumed most people would go to the docs site, instead of to the README. There’s a whole section there.

bozhidar13:06:25

I also think it’s linked from the contribution templates, etc. No harm in adding it to the README as well.

bozhidar13:06:58

@dumrat I see you’re using a very old version of CIDER. I’d recommend updating to the current version (0.21) or the current dev version (0.22-snapshot).

bozhidar13:06:16

Also make sure you’re running Lein 2.9.1+.

pez14:06:05

@bozhidar, I would have googled it, never occurred to me to check the docs site. 😃

benedek16:06:46

@ericihli yup, this got fixed tho. you just need to use a snaphsot version, see the related refactor-nrepl version issue (from the spacemacs issue)

bozhidar16:06:53

@pez No one ever reads the docs. 😄

dumrat17:06:28

Updated lein, reinstalled everything. I still get this error:

[nREPL] Starting server via /usr/local/bin/lein update-in :dependencies conj \[nrepl\ \"0.6.0\"\] -- update-in :plugins conj \[refactor-nrepl\ \"2.4.0\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.22.0-beta4\"\] -- repl :headless :host localhost...
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: Exception in thread "main" java.lang.RuntimeException: Unable to resolve symbol: create in this context, compiling:(/private/var/folders/g_/ldc4hkys4r73yffyf77pcn1c0000gn/T/form-init8632471219806107511.clj:4223:33)
	at clojure.lang.Compiler.analyze(Compiler.java:6688)
	at clojure.lang.Compiler.analyze(Compiler.java:6625)
	at clojure.lang.Compiler$HostExpr$Parser.parse(Compiler.java:1009)
	at clojure.lang.Compiler.analyzeSeq(Compiler.java:6868)
	at clojure.lang.Compiler.analyze(Compiler.java:6669)
	at clojure.lang.Compiler.analyzeSeq(Compiler.java:6856)
	at clojure.lang.Compiler.analyze(Compiler.java:6669)
	at clojure.lang.Compiler.access$300(Compiler.java:38)
	at clojure.lang.Compiler$LetExpr$Parser.parse(Compiler.java:6269)
	at clojure.lang.Compiler.analyzeSeq(Compiler.java:6868)
	at clojure.lang.Compiler.analyze(Compiler.java:6669)
	at clojure.lang.Compiler.analyzeSeq(Compiler.java:6856)
	at clojure.lang.Compiler.analyze(Compiler.java:6669)
	at clojure.lang.Compiler.analyzeSeq(Compiler.java:6856)
	at clojure.lang.Compiler.analyze(Compiler.java:6669)
	at clojure.lang.Compiler.analyze(Compiler.java:6625)
	at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3834)
	at clojure.lang.Compiler.analyzeSeq(Compiler.java:6870)
	at clojure.lang.Compiler.analyze(Compiler.java:6669)
	at clojure.lang.Compiler.analyze(Compiler.java:6625)
	at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3834)
	at clojure.lang.Compiler.analyzeSeq(Compiler.java:6870)
	at clojure.lang.Compiler.analyze(Compiler.java:6669)
	at clojure.lang.Compiler.access$300(Compiler.java:38)
	at clojure.lang.Compiler$LetExpr$Parser.parse(Compiler.java:6269)
	at clojure.lang.Compiler.analyzeSeq(Compiler.java:6868)
	at clojure.lang.Compiler.analyze(Compiler.java:6669)
	at clojure.lang.Compiler.analyze(Compiler.java:6625)
	at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:6001)
	at clojure.lang.Compiler$FnMethod.parse(Compiler.java:5380)
	at clojure.lang.Compiler$FnExpr.parse(Compiler.java:3972)
	at clojure.lang.Compiler.analyzeSeq(Compiler.java:6866)
	at clojure.lang.Compiler.analyze(Compiler.java:6669)
	at clojure.lang.Compiler.eval(Compiler.java:6924)
	at clojure.lang.Compiler.eval(Compiler.java:6917)
	at clojure.lang.Compiler.eval(Compiler.java:6917)
	at clojure.lang.Compiler.load(Compiler.java:7379)
	at clojure.lang.Compiler.loadFile(Compiler.java:7317)
	at clojure.main$load_script.invokeStatic(main.clj:275)
	at clojure.main$init_opt.invokeStatic(main.clj:277)
	at clojure.main$init_opt.invoke(main.clj:277)
	at clojure.main$initialize.invokeStatic(main.clj:308)
	at clojure.main$null_opt.invokeStatic(main.clj:342)
	at clojure.main$null_opt.invoke(main.clj:339)
	at clojure.main$main.invokeStatic(main.clj:421)
	at clojure.main$main.doInvoke(main.clj:384)
	at clojure.lang.RestFn.invoke(RestFn.java:421)
	at clojure.lang.Var.invoke(Var.java:383)
	at clojure.lang.AFn.applyToHelper(AFn.java:156)
	at clojure.lang.Var.applyTo(Var.java:700)
	at clojure.main.main(main.java:37)
Caused by: java.lang.RuntimeException: Unable to resolve symbol: create in this context
	at clojure.lang.Util.runtimeException(Util.java:221)
	at clojure.lang.Compiler.resolveIn(Compiler.java:7164)
	at clojure.lang.Compiler.resolve(Compiler.java:7108)
	at clojure.lang.Compiler.analyzeSymbol(Compiler.java:7069)
	at clojure.lang.Compiler.analyze(Compiler.java:6648)
	... 50 more
Subprocess failed

dpsutton17:06:31

Which clojure version are you using. And can you get a running repl with just “lein repl”?

dumrat17:06:27

@dpsutton: Turns out, I can't.

Dumindas-MacBook-Pro:~ duminda$ lein --version
Leiningen 2.9.1 on Java 1.8.0_181 Java HotSpot(TM) 64-Bit Server VM

Dumindas-MacBook-Pro:~ duminda$ lein repl
[WARNING] No nREPL middleware descriptor in metadata of #'clojure.tools.nrepl.middleware.render-values/render-values, see nrepl.middleware/set-descriptor!
nREPL server started on port 54673 on host 127.0.0.1 - 
ERROR: Unhandled REPL handler exception processing message {:id ca4db4fe-4051-4a1c-95b1-6394eac16366, :op clone}
java.lang.IllegalArgumentException: No implementation of method: :send of protocol: #'nrepl.transport/Transport found for class: clojure.tools.nrepl.middleware.render_values$wrap_renderer$reify__3935
	at clojure.core$_cache_protocol_fn.invokeStatic(core_deftype.clj:583)
	at clojure.core$_cache_protocol_fn.invoke(core_deftype.clj:575)
	at nrepl.transport$fn__9103$G__9098__9110.invoke(transport.clj:16)
	at nrepl.middleware.print$send_nonstreamed.invokeStatic(print.clj:157)
	at nrepl.middleware.print$send_nonstreamed.invoke(print.clj:138)
	at nrepl.middleware.print$printing_transport$reify__9539.send(print.clj:174)
	at nrepl.middleware.caught$caught_transport$reify__9570.send(caught.clj:58)
	at nrepl.middleware.session$register_session.invokeStatic(session.clj:205)
	at nrepl.middleware.session$register_session.invoke(session.clj:197)
	at nrepl.middleware.session$session$fn__9743.invoke(session.clj:267)
	at nrepl.middleware$wrap_conj_descriptor$fn__9350.invoke(middleware.clj:16)
	at nrepl.middleware.load_file$wrap_load_file$fn__9657.invoke(load_file.clj:81)
	at nrepl.middleware$wrap_conj_descriptor$fn__9350.invoke(middleware.clj:16)
	at nrepl.middleware.caught$wrap_caught$fn__9579.invoke(caught.clj:97)
	at nrepl.middleware$wrap_conj_descriptor$fn__9350.invoke(middleware.clj:16)
	at nrepl.middleware.print$wrap_print$fn__9550.invoke(print.clj:234)
	at nrepl.middleware$wrap_conj_descriptor$fn__9350.invoke(middleware.clj:16)
	at clojure.tools.nrepl.middleware.render_values$render_values$fn__3943.invoke(render_values.clj:42)
	at clojure.tools.nrepl.middleware$wrap_conj_descriptor$fn__1100.invoke(middleware.clj:22)
	at nrepl.server$handle_STAR_.invokeStatic(server.clj:18)
	at nrepl.server$handle_STAR_.invoke(server.clj:15)
	at nrepl.server$handle$fn__9774.invoke(server.clj:27)
	at clojure.core$binding_conveyor_fn$fn__5739.invoke(core.clj:2030)
	at clojure.lang.AFn.call(AFn.java:18)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

dpsutton17:06:38

the project you are using depends on clojure.tools.nrepl. lein depends on the new nrepl/nrepl. Can you bump that dep?

dumrat17:06:28

@dpsutton Sorry, prev was outside project dir. Here's what happens when I run lein repl inside project dir.

Exception in thread "main" java.lang.RuntimeException: Unable to resolve symbol: create in this context, compiling:(/private/var/folders/g_/ldc4hkys4r73yffyf77pcn1c0000gn/T/form-init1899146372180899917.clj:4223:33)
Exception in thread "main" java.lang.RuntimeException: Unable to resolve symbol: create in this context, compiling:(/private/var/folders/g_/ldc4hkys4r73yffyf77pcn1c0000gn/T/form-init1899146372180899917.clj:4223:33)
	at clojure.lang.Compiler.analyze(Compiler.java:6688)
...

dpsutton17:06:19

well its not a CIDER issue then. Are there any usages of create in your project?

dumrat17:06:23

@dpsutton: Ok, I had edited a namespace name in a source file and that was the reason for the create error. However, after fixing the namespace name, I face the previous error with lein repl. "the project you are using depends on clojure.tools.nrepl. lein depends on the new nrepl/nrepl. Can you bump that dep?" My project file has no dependencies except clojure-1.8.0. So it's unclear to me what to do here.

dpsutton17:06:40

is it public?

dpsutton17:06:40

can you place the error you're seeing now? I'm not sure i'm clear on what you are seeing now that the "create" bug is resolved

dumrat18:06:04

I get this error now:

[WARNING] No nREPL middleware descriptor in metadata of #'clojure.tools.nrepl.middleware.render-values/render-values, see nrepl.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'refactor-nrepl.middleware/wrap-refactor, see nrepl.middleware/set-descriptor!
nREPL server started on port 54796 on host localhost - 
ERROR: Unhandled REPL handler exception processing message {:op clone, :id 1}
java.lang.IllegalArgumentException: No implementation of method: :send of protocol: #'nrepl.transport/Transport found for class: clojure.tools.nrepl.middleware.render_values$wrap_renderer$reify__2021
	at clojure.core$_cache_protocol_fn.invokeStatic(core_deftype.clj:568)
	at clojure.core$_cache_protocol_fn.invoke(core_deftype.clj:560)
	at nrepl.transport$eval402$fn__403$G__393__410.invoke(transport.clj:16)
	at nrepl.middleware.session$register_session.invokeStatic(session.clj:205)
	at nrepl.middleware.session$register_session.invoke(session.clj:197)
	at nrepl.middleware.session$session$fn__1105.invoke(session.clj:267)
	at nrepl.middleware$wrap_conj_descriptor$fn__668.invoke(middleware.clj:16)
	at refactor_nrepl.middleware$wrap_refactor$fn__6497.invoke(middleware.clj:214)
	at clojure.tools.nrepl.middleware$wrap_conj_descriptor$fn__1850.invoke(middleware.clj:22)
	at clojure.tools.nrepl.middleware.render_values$render_values$fn__2027.invoke(render_values.clj:42)
	at clojure.tools.nrepl.middleware$wrap_conj_descriptor$fn__1850.invoke(middleware.clj:22)
	at nrepl.server$handle_STAR_.invokeStatic(server.clj:18)
	at nrepl.server$handle_STAR_.invoke(server.clj:15)
	at nrepl.server$handle$fn__1142.invoke(server.clj:27)
	at clojure.core$binding_conveyor_fn$fn__4676.invoke(core.clj:1938)
	at clojure.lang.AFn.call(AFn.java:18)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
proj file: https://github.com/nakiya/paint/blob/master/project.clj

dpsutton18:06:00

do you have a file at ~/.lein/profiles.clj?

dpsutton18:06:42

from your stacktrace #'clojure.tools.nrepl.middleware.render-values means that somehow clojure.tools.nrepl is involved. And since you have lein 2.9.1 it must be nrepl/nrepl

dumrat18:06:24

~/.lein/profiles.clj:

{:user {:plugins [[venantius/ultra "0.5.2"]]}
        :dependencies [[org.clojure/tools.trace "0.7.10"]]}
}

dumrat18:06:41

Is it due to org.clojure/tools.trace?

dpsutton18:06:52

i'm guessing venatius

dpsutton18:06:03

but just try it with one commented out and then the other.

dpsutton18:06:21

But venatius is made for a good lein-repl experience and you'r eusing CIDER so i don't see the value of it for you

dpsutton18:06:36

But fundamentally these global things are always pains and you should get rid of them

dumrat18:06:21

After removing ~/.lein/profiles.clj everything is fine. Thank you @dpsutton for your help.

dpsutton18:06:38

glad i could help. happy coding 🙂

pez20:06:23

Haha, @bozhidar , I am one to read the docs. But just a mention in the readme about checking the docs for how to hack on CIDER, would be good.