Fork me on GitHub
#calva
<
2021-11-16
>
Yuner Bekir09:11:09

Hi guys. Is there a way to configure my project in such a manner that Calva will handle compiling my less files? Currently I am running an extra command which compiles them on save, but after a few recompilations I am unable to evaluate anything in the REPL or the cljs files

pez09:11:24

There is no way to get Calva to handle that. Why would recompiling less files interfere with the REPL? That sounds strange…

Yuner Bekir10:11:04

It causes the page to refresh multiple times, because multiple files get updated. I am not sure how Calva works, but maybe if it has a state it gets corrupted? For example if a refresh is triggered before the previous one has finished

pez10:11:00

The REPL probably doesn’t like the refreshes. Is it a shadow-cljs project?

Yuner Bekir10:11:40

Legacy figwheel

pez10:11:30

I think you need to stop the automatic refreshing. Or, when the REPL stops working like that. Try to reload the page and see if it starts working again. However, every time the page refreshes you will lose app state, which doesn’t seem optimal at all.

pez10:11:13

You could also try to reconnect Calva’s repl when you experience the problem. Thinking if Calva’s automatic reconnect might not keep up with the refreshes…

Yuner Bekir10:11:02

I will try, thanks 🙂

Yuner Bekir11:11:11

Now it happened without the less files. I got the following error while trying to connect to the current running repl:

Yuner Bekir11:11:51

and it also seems like that any changes to the files doesn't get reloaded. Only restarting vscode solves the problem

pez11:11:30

There’s an output channel named “Calva Connection Log” which might contain clues when you get that error connecting.

pez11:11:41

Are you using WSL?

Yuner Bekir12:11:26

After killing and restarting in the connection log I get "socket closed". To my knowledge I am not running WSL.

pez12:11:27

Sorry, I don’t follow what “killing and restarting in the connection log” means?

Yuner Bekir13:11:57

I use the "ctrl + c " combination in the terminal, which terminates (kills) the current nRepl server

pez13:11:18

So, when you have jacked-in and it gives you that “Error while connecting CLJS REPL”. What do you see in the Connection Log? (NB: This is not the Calva Output/REPL, but a channel in the Output panel.)

Yuner Bekir14:11:38

Let me describe it better: 1. I notice that I can't evaluate anything in the repl, it gets stuck on the evaluation 2. I terminate the repl 3. Then I try to jack-in I see the Error while connecting cljs REPL: TypeError: Cannot read property 'search' of undefined error 4. In the Calva connection log I see "Socket closed" (see attachment) Note: The connection log has information from the first startup, which in time wasn't able to evaluate in the repl. The only new line added is "Socket closed"

pez14:11:11

So the “Socket closed” isn’t a result of terminating the REPL?

Yuner Bekir15:11:50

No. Its the result from attempting to start-up a new REPL or connect to an existing one. After restarting vscode and start-up a new REPL I can no longer see the "socket closed" message.

pez15:11:11

Hmmm. I don’t know where things go wrong. … There is an nREPL message log since recently. Maybe it has some clues for us. Start it with the command Calva Diagnistics: toggle nREPL something something

Yuner Bekir08:11:15

I just went through a log. What I notice is that I am only sending to the repl but not receiving. I have attached a part of the log

bringe05:11:36

Hey, the log has sort of come in handy already! 😃 It seems like something is going wrong in the server and putting it in some state in which it either isn’t processing input or just isn’t responding for some reason.

bringe05:11:20

If you could share a repo with a small project in which you can reproduce the issue, that would be helpful for us to troubleshoot.

bringe05:11:46

I suppose it could also be that the message isn’t even making it to the server in the first place, as I think we log that right before writing the message.

Yuner Bekir12:11:49

I am having this issue on the company project I am currently working at. Sadly I can't share it. I will try to cleanup the project and if the issue is reproducible I will give you the source code

bringe23:11:59

Yeah, just some other sample project where it’s reproducible would work, if you can make such a thing.

Ryan Jerue15:11:12

I got a fun one Two tests:

(deftest name-with+in-it
  (is true))

(deftest name-with-plus-in-it
  (is true))
When I use the calva test runner on them
; Evaluating file: fun_test.clj
#'app.fun-test/name-with-plus-in-it
; Running test: name-with+in-it…
; No tests found. 😱, ns: 0, vars: 0
clj꞉app.fun-test꞉> 
; Evaluating file: fun_test.clj
#'app.fun-test/name-with-plus-in-it
; Running test: name-with-plus-in-it…
; 1 tests finished, all passing 👍, ns: 1, vars: 1
clj꞉app.fun-test꞉> 
The one called name-with+in-it for some reason isn’t getting run.

pez15:11:29

Hahaha, fun. 😃

pez15:11:15

Well, it’s a good find. Please file an issue. Not sure if it is upstream in cider-nrepl or just in Calva, but we can start with Calva.

👍 1