This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-12-05
Channels
- # adventofcode (50)
- # announcements (1)
- # asami (29)
- # babashka (56)
- # beginners (19)
- # calva (62)
- # cider (12)
- # cljs-dev (1)
- # clojure (42)
- # clojure-europe (214)
- # clojure-france (4)
- # clojure-italy (1)
- # clojurescript (58)
- # community-development (4)
- # cryogen (6)
- # cursive (7)
- # data-science (1)
- # events (3)
- # figwheel-main (1)
- # fulcro (21)
- # lambdaisland (3)
- # malli (17)
- # mid-cities-meetup (1)
- # off-topic (38)
- # pathom (3)
- # reagent (7)
- # reclojure (1)
- # reveal (15)
- # rewrite-clj (11)
- # shadow-cljs (30)
- # sql (21)
- # test-check (14)
- # tools-deps (1)
- # vim (21)
- # xtdb (5)
Calva isn't evaluating for me. I'm using WSL2, and my project uses legacy figwheel (lein reagent template). I get "jack in done", but whenever I try to evaluate something, nothing happens. When I hover code, it says "loading". I tried a regular clojure lein project as well, and the same thing happened. Calva used to work on my system a few months ago, but now it doesn't.
Hi! I'm trying to transition from my old, tired Mac to a new shiny desktop that is running windows. I'm trying to follow the instructions to get a luminus project running in VSCode. I created a luminus project with lein new luminus box2box +re-frame +postgres +shadow-cljs
and then from VSCode did the C-A-C C-A-J thing and selected Server + Client. In the output.calva-repl window I get the following exception:
Not sure where to go from here - I can't seem to get to the clj.user namespace to call (start) manually.
clj::cljs.user=> (start)
nil
; No available JS runtime.
; See
clj::cljs.user=> (ns clj.user)
nil
; No available JS runtime.; See
clj::cljs.user=> (in-ns clj.user)
nil
; No available JS runtime.
; See
clj::cljs.user=>
For some reason Calva tries to evaluate (start)
in cljs repl. Thus it fails.
I’l have a look @zelark. The reason it runs start is that it is configured as afterCLJReplJackInCode
in the connect sequence. To get past that blocker for now you can just remove the afterCLJReplJackInCode
entry from the workspace settings.
You’ll need to figure out how to start the luminus server, though. And once you figure that out you can probably figure out what that settings should be now, in case you still want it started as part of jack in.
Thanks! I don't mind starting it any which way, I was just trying to follow the various tutorials I found. Appreciate the pointer to afterCLJReplJackInCode
.
@pez but why it runs start
in cljs repl? It says “`afterCLJReplJackInCode`: Here you can give Calva some Clojure code to evaluate in the CLJ REPL, once it has been created.”
@zelark Why do you think it's trying to run (start)
in the CLJS repl? The ouptut says it's connected to the CLJ repl... then the stack trace, then finally it says creating the cljs repl -- after the stack trace.
Oh, I think you're looking at the second bit I pasted? That was just me noodling around. The error is in the snippet above.
Oh, now I see that it is @credulous reporting the problem. 😃
If you look at the status bar, you can see that the current repl is cljs. Also, if you start just a server, it works fine, and start
is evaluated.
I just reproduced it locally.
@brandon.ringe could it be something with how we have changed the repl connect code some months ago, you think?
@zelark since you have it up and running. Can you test if it works to switch to the clj
repl and evaluate (start)
even when starting both the client and the server?
Oh, sorry then, but mine is cljs
but my prompt shows I'm in the cljs.user
namespace. I can't seem to switch to the clj.user
namespace, which was the second bit I pasted.
I'm sure this is all operator error - I'm a total newb to this environment. Vim/Fireplace is where i've done my work in the past
You can switch to the clj
repl using the Calva: Toggle REPL Connection used for cljc files
@pez sure, it works, but I need to do (in-ns ’user) first
Iirc, I added a custom command snippet to that project to start the server. If I did, can you try if that one wokrs?
@credulous I found a workaround to that. You can just set afterCLJReplJackInCode
to "(user/start)"
. It works for me.
It lives in <your-project>/.vscode/settings.json
That error could be because previous failed attempts has leftt something in a bad state. See if it helps closing the project and opening it again.
Yes, actually it ran user/start as the stacktrace says, but then down the road something bad happened
mount.core/start-without (core.cljc:403)
user/start (user.clj:22)
Nope. With that it fails as in @credulous first report. That probably means that something in shadow-cljs has changed since I configured the template, making it start in some other ns
. I’ll update the template.
@pez what about this WA, does it work for you?
It works for me. @https://app.slack.com/team/U0LJ1RNS0 got an error, but I believe it’s something different
Oh, I interpreted this as you ran into troubles later: > but then down the road something bad happened
But you were referring to the logs, I understand now. In any case, I think it is better to change ns first, because that is what has changed.
Btw, I found another way to fix that, I believe the right one.
As the docs says one can put init-ns
in a config file. So I put :init-ns user
in project.clj and it fixed the problem.
No, it’s under :shadow-cljs key
:shadow-cljs
{:nrepl {:port 7002 :init-ns user}
I'm getting the same error as I got before... this is clearly a problem with my local configuration. I really appreciate you guys digging in! I'm going to try to figure out what's borked on my end.
@credulous make sure that your database is running, probably it’s the cause
I got exactly the same exception when I uncommented :database-url
in my dev-config.edn
just found the same thing. It's working now, and I can continue my day knowing I wasted the time of two very helpful people
No problem, at least we found a place to fix.
> I found a workaround to that. You can just set `afterCLJReplJackInCode` to `"(user/start)"` . It works for me. Yes, I've found this issue and solution before
Calva friends, if you want to get a taste of some clojure-lsp integration, here's a vsix for the branch that's a WIP: https://8915-125431277-gh.circle-artifacts.com/0/tmp/artifacts/calva-2.0.135-feat-lsp-client-853d7c2e.vsix There are indeed rough edges, but I think we can sort them out in time. Feel free to comment on anything unusual/broken on this PR: https://github.com/BetterThanTomorrow/calva/pull/572
With this vsix, go to definition works a bit better (and without a repl connection!), code lens for references exist, and if you click them you can peek the references. You may will see duplicate completions when you have a repl connection. I've yet to get to that, but there's some work to be done there on the lsp side, I think. You may also see some linting of the .calva-repl file, another thing I haven't gotten to, but I think this is a matter of configuration of kondo through lsp.