Fork me on GitHub
#calva
<
2023-05-17
>
jlmr10:05:20

Since today I can no longer Jack-In. I’ve just created a clean project (based on org.corfield.new/scratch) with no dependencies at all. Jack-in fails with the following stacktrace (see thread). I have no clue why this issue manifested today all of a sudden. Anyone any idea?

jlmr10:05:37

Stacktrace:

This is a pseudo terminal, only used for hosting the Jack-in REPL process. It takes no input.
Pressing ctrl+c with this terminal focused, killing this terminal, or closing/reloading the VS Code window will all stop/kill the Jack-in REPL process.

⚡️ Starting the REPL ⚡️ using the below command line:
pushd /Users/jlmr/Code/test-calva ; clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version,"1.0.0"},cider/cider-nrepl {:mvn/version,"0.28.5"}}}' -M -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]" ; popd
nREPL server started on port 56756 on host localhost - 
ERROR: Unhandled REPL handler exception processing message {:op eval, :code *ns*, :id 1}
Syntax error macroexpanding at (cider/nrepl/inlined_deps/orchard/v0v9v2/orchard/java/parser.clj:1:1).
        at clojure.lang.Compiler.load(Compiler.java:7665)
<elided>
        at $eval4249$loading__6789__auto____4250.invoke(info.clj:1)
        at $eval4249.invokeStatic(info.clj:1)
        at $eval4249.invoke(info.clj:1)
<elided>
        at clojure.lang.RestFn.invoke(RestFn.java:930)
        at cider.nrepl.middleware.stacktrace$eval4241$loading__6789__auto____4242.invoke(stacktrace.clj:1)
        at cider.nrepl.middleware.stacktrace$eval4241.invokeStatic(stacktrace.clj:1)
        at cider.nrepl.middleware.stacktrace$eval4241.invoke(stacktrace.clj:1)
<elided>
        at cider.nrepl.middleware.debug$eval4233$loading__6789__auto____4234.invoke(debug.clj:1)
        at cider.nrepl.middleware.debug$eval4233.invokeStatic(debug.clj:1)
        at cider.nrepl.middleware.debug$eval4233.invoke(debug.clj:1)
<elided>
        at cider.nrepl$wrap_debug$fn__2388.invoke(nrepl.clj:163)
        at nrepl.middleware$wrap_conj_descriptor$fn__962.invoke(middleware.clj:16)
        at cider.nrepl.middleware.inspect$eval_reply.invokeStatic(inspect.clj:71)
        at cider.nrepl.middleware.inspect$eval_reply.invoke(inspect.clj:69)
        at cider.nrepl.middleware.inspect$handle_inspect.invokeStatic(inspect.clj:110)
        at cider.nrepl.middleware.inspect$handle_inspect.invoke(inspect.clj:108)
        at clojure.lang.Var.invoke(Var.java:388)
        at cider.nrepl$wrap_inspect$fn__2422.invoke(nrepl.clj:227)
        at nrepl.middleware$wrap_conj_descriptor$fn__962.invoke(middleware.clj:16)
        at nrepl.middleware.load_file$wrap_load_file$fn__1840.invoke(load_file.clj:81)
        at nrepl.middleware$wrap_conj_descriptor$fn__962.invoke(middleware.clj:16)
        at cider.nrepl.middleware.track_state$handle_tracker.invokeStatic(track_state.clj:244)
        at cider.nrepl.middleware.track_state$handle_tracker.invoke(track_state.clj:242)
        at clojure.lang.Var.invoke(Var.java:388)
        at cider.nrepl$wrap_tracker$fn__2510.invoke(nrepl.clj:482)
        at nrepl.middleware$wrap_conj_descriptor$fn__962.invoke(middleware.clj:16)
        at nrepl.middleware.caught$wrap_caught$fn__1231.invoke(caught.clj:97)
        at nrepl.middleware$wrap_conj_descriptor$fn__962.invoke(middleware.clj:16)
        at cider.nrepl$wrap_out$fn__2446.invoke(nrepl.clj:334)
        at nrepl.middleware$wrap_conj_descriptor$fn__962.invoke(middleware.clj:16)
        at cider.nrepl.middleware.content_type$handle_content_type.invokeStatic(content_type.clj:144)
        at cider.nrepl.middleware.content_type$handle_content_type.invoke(content_type.clj:131)
        at clojure.lang.Var.invoke(Var.java:388)
        at cider.nrepl$wrap_content_type$fn__2346.invoke(nrepl.clj:107)
        at nrepl.middleware$wrap_conj_descriptor$fn__962.invoke(middleware.clj:16)
        at nrepl.middleware.print$wrap_print$fn__1198.invoke(print.clj:234)
        at nrepl.middleware$wrap_conj_descriptor$fn__962.invoke(middleware.clj:16)
        at nrepl.middleware.sideloader$wrap_sideloader$fn__1921.invoke(sideloader.clj:108)
        at nrepl.middleware$wrap_conj_descriptor$fn__962.invoke(middleware.clj:16)
        at cider.nrepl$wrap_enlighten$fn__2396.invoke(nrepl.clj:190)
        at nrepl.middleware$wrap_conj_descriptor$fn__962.invoke(middleware.clj:16)
        at nrepl.middleware.session$session$fn__1401.invoke(session.clj:325)
        at nrepl.middleware$wrap_conj_descriptor$fn__962.invoke(middleware.clj:16)
        at nrepl.server$default_handler$fn__1969.invoke(server.clj:141)
        at nrepl.server$handle_STAR_.invokeStatic(server.clj:24)
        at nrepl.server$handle_STAR_.invoke(server.clj:21)
        at nrepl.server$handle$fn__1937.invoke(server.clj:41)
        at clojure.core$binding_conveyor_fn$fn__5823.invoke(core.clj:2047)
        at clojure.lang.AFn.call(AFn.java:18)
        at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: jdk.javadoc.doclet.Doclet
        at java.base/java.net.URLClassLoader.findClass(Unknown Source)
        at clojure.lang.DynamicClassLoader.findClass(DynamicClassLoader.java:69)
        at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
        at clojure.lang.DynamicClassLoader.loadClass(DynamicClassLoader.java:77)
        at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
        at java.base/java.lang.Class.forName0(Native Method)
        at java.base/java.lang.Class.forName(Unknown Source)
        at clojure.lang.RT.classForName(RT.java:2209)
        at clojure.lang.RT.classForNameNonLoading(RT.java:2222)
        at cider.nrepl.inlined_deps.orchard.v0v9v2.orchard.java.parser$eval4444$loading__6789__auto____4445.invoke(parser.clj:1)
        at cider.nrepl.inlined_deps.orchard.v0v9v2.orchard.java.parser$eval4444.invokeStatic(parser.clj:1)
        at cider.nrepl.inlined_deps.orchard.v0v9v2.orchard.java.parser$eval4444.invoke(parser.clj:1)
        at clojure.lang.Compiler.eval(Compiler.java:7194)
        at clojure.lang.Compiler.eval(Compiler.java:7183)
        at clojure.lang.Compiler.load(Compiler.java:7653)
        ... 188 more

jlmr10:05:12

I’ve elided parts of the stacktrace because Slack was complaining about the number of characters

pez10:05:30

Strange. Can you try with v2.0.358 and see if that makes a difference? We have made some changes to jack-in the last few days, and had some problems with regressions. This doesn’t look like any of that, but if it works with 358 and not in latest Calva, then it is any of that.

jlmr11:05:52

How can I switch to a different version of Calva?

jlmr11:05:07

I’ve never tried switching versions before 😇

pez11:05:02

From the cogwheel icon on the Calva entry in the Extensions pane.

jlmr11:05:30

@U0ETXRFEW switching to 358 did not fix it unfortunately

👀 2
👂 2
pez11:05:22

That’s good, I think. 😃

jlmr11:05:51

Ok, so I should switch to a version that’s older than 358?

pez11:05:02

No, I don’t think a Calva change causes this. You haven’t changed anything with Java version?

jlmr11:05:34

switching to temurin 11 fixed it 🎉

pez11:05:16

Great, I guess from your emoji. 😃 What I do to control which environment VS Code runs with is that I start it with the code command line, from a terminal that has the environment I need.

jlmr11:05:41

yes I also always start using code I guess some recent changes in my shell config triggered this issue

pez11:05:28

Which Java version caused the problem? If we have that in this thread, people might find it in searches.

jlmr11:05:52

temurin-jre-17.0.7+7

jlmr12:05:31

Thanks for the help!

pez12:05:17

You’re welcome, @U56R03VNW!

skylize13:05:55

Further investigation might be still be a good idea for you. Why is an upgrade from JRE 11 to 17 causing breakage?

Don Jennings01:07:46

Hi, folks. Thanks for this thread as it and other resources helped me resolve this issue: install a JDK (instead of a JRE) via https://asdf-vm.com/ 🙂

k3nj1g10:05:14

I started using this connect sequences by repl started in standalone terminal. To build ui we are using Figwheel, so the connect sequence has "cljsType": "Figwheel Main". When I try to reconnect to the repl, it says that "A build with id "dev" is already running". What a best approach to reconnect to figwheel?

pez10:05:29

Is it then failing to connect, you say?

pez11:05:17

How is the REPL started? Can you share some more info on that?

k3nj1g11:05:26

repl started with cd ui clj -M:calva:test:back-test:nrepl:portal

pez11:05:08

Does it work to jack-in? Not suggesting that you do that, it’s just a test. If you test it, then only select the aliases test, back-test, and portal.

k3nj1g11:05:23

connect sequence: { "calva.replConnectSequences": [ { "name": "front+back", "projectType": "deps.edn", "projectRootPath": [ ".", "ui" ], "cljsType": "Figwheel Main" } ] }

k3nj1g11:05:31

Jack-In is working this aliases

pez11:05:49

If you copy the jack-in command when using only the aliases I suggest. And run that command for starting the repl. Can you reconnect then? I somehow doubt it, but wanna check.

k3nj1g11:05:58

Sure, let me check

k3nj1g11:05:59

Without calva alias Figwheel won't start due to calva.user.clj requires figwheel.main.api Error is: Could not locate figwheel/main/api__init.class, figwheel/main/api.clj or figwheel/main/api.cljc on classpath.

pez11:05:22

Oh, I see. If that’s the only thing happening, by all means include it. (And consider naming it fig or somegthing 😃 )

k3nj1g11:05:13

Without nrepl alias clojure will start

k3nj1g11:05:28

nrepl alias: :nrepl {:extra-deps {cider/cider-nrepl {:mvn/version "LATEST"} refactor-nrepl/refactor-nrepl {:mvn/version "2.5.0"} cider/piggieback {:mvn/version "0.4.2"}} :main-opts ["-m" "nrepl.cmdline" "--middleware" "[cider.nrepl/cider-middleware]" "--port" "55555"] :jvm-opts ["-Xmx512M" "-XX:-OmitStackTraceInFastThrow"]}

pez11:05:42

Do any of the other aliases have main-opts? I think you could run in to problems with that old piggieback. But I don’t think any of this is the problem with reconnect. Just trying to exclude things here.

k3nj1g11:05:16

Do we need main-opts for developing purposes? Since Jack-In without nrepl alias works just fine.

pez11:05:18

No, you don’t need that. I was just confused why the clojure prompt appeared if you were using the command line you get from Copy Jack-in Command Line. Because that command line should not need the nrepl alias.

k3nj1g12:05:48

Well, I copied exact Jack-In command, added some envs, then my backed started. Next I connected with Figwheel cljs type, reloaded vscode, reconnected. Reconnection happened. Still got this "A build with id "dev" is already running." Also after reload in the repl there were Exceptions ERROR: Unhandled REPL handler exception processing message {:op close, :session 83b85b52-2bec-49d3-814c-792a12323ec4} java.net.SocketException: Socket closed

k3nj1g12:05:10

So I wonder if this "A build with id "dev" is already running." error matters

pez12:05:29

Ah, that was what my first question in this thread was about. 😃 If the connection happens, it doesn’t matter.

pez12:05:57

Let me check if that message comes from Calva…

pez12:05:45

No, it is Figwheel Main. And now I recall I have asked for a better API for this, four years ago 😃 https://github.com/bhauman/figwheel-main/issues/166

k3nj1g12:05:12

Got it! Thank you! And, yeah, sometimes repl stucks in user.clj after reconnecting, like that said in the comment. So I guess we should put up with it.

pez12:05:39

That, or consider shadow-cljs.

👍 2
mmer11:05:21

Hi Is there anyway to get the repl window to be along the bottom of the view?

pez11:05:09

Depends on if you want the panel with terminals and such on the bottom, then no. I tend to drag terminals I am interested in into the editor area and hide the panel.

mmer11:05:24

So if you hide the terminal side of things can you get the repl at the bottom

mmer11:05:53

To me this is a major pain. I came from using cursive and having a small repl window at the bottom means you can see the whole of the text file.

pez11:05:01

Editor panes can be tiled among themselves. And the REPL window is an editor. So you if you only have editors you can have a small repl window at the bottom. And, terminals can be tiled with editor panes. It is for some reason super restricted where you can place things in VS Code. I once asked for a change to this, but it was deemed out of scope: https://github.com/microsoft/vscode/issues/68831

mmer11:05:06

With terminals I can interact with them, so why can't the repl not be an editor panel.

pez11:05:22

It could be, but there are trade-offs that has made us choose to use a regular file for it. We have used terminals and we have used a webview. We are now considering making a write only output, but we don’t have any concrete plans for it.

mmer11:05:51

I would be up for a read-only repl as I always use a file to save my code in.

🙏 2
👍 2
pez11:05:08

Do you mean write-only? 😃

pez11:05:43

I don’t know what the term is. Maybe write-only is confusing. Read-only makes sense now. 😃

mmer11:05:04

What I mean is a repl that receives input from a remote file and prints the output.

pez11:05:09

Anyway, we are considering an output window. Which isn’t a REPL prompt.

skylize14:05:53

From user perspective, I think read-only is what you're going for.

skylize14:05:12

I don't understand why the Panel is the way it is. Frustrating in multiple ways. I think all the things that go in the panel should be free like editors. But I wasn't consulted 😉. Anyway. You can at least move the Panel to one side to gain more vertical real estate. (Making up the name "Panel-Tabs" for the top bar of the Panel, with "tabs" of Problems, Output, Terminal, etc.)

right-click Panel-Tabs 
-> click Panel Position
-> click Left <or> click Right