conjure

reefersleep 2024-05-08T14:31:46.994589Z

I keep getting

; Sponsored by @trev-dev ❤
; --------------------------------------------------------------------------------
; localhost:52680 (ECONNREFUSED): .nrepl-port
; --------------------------------------------------------------------------------
; localhost:52680 (disconnected): .nrepl-port
After something odd happened in nvim and I force quit it.

reefersleep 2024-05-08T14:32:27.155749Z

I did killall nvim successfully. But now I can't connect to the Conjure repl.

reefersleep 2024-05-08T14:33:19.951449Z

It's a small babashka project.

reefersleep 2024-05-08T14:34:05.616409Z

Maybe there's a rogue Conjure process I need to kill?

reefersleep 2024-05-08T14:35:16.696899Z

Doesn't matter if I change the port.

Samuel Ludwig 2024-05-08T14:36:25.530329Z

Is there by chance an .nrepl-port file still in your filetree?

reefersleep 2024-05-08T14:36:50.039419Z

Yes, that's where I changed the port

Samuel Ludwig 2024-05-08T14:36:59.128659Z

try and rm that file?

reefersleep 2024-05-08T14:37:33.113259Z

Now I started a babashka repl in a different way,

nrepl {:requires ([babashka.fs :as fs]
                                    [babashka.nrepl.server :as srv])
                         :task (do (srv/start-server! {:host "localhost"
                                                       :port 1339})
                                   (spit ".nrepl-port" "1339")
                                   (-> (Runtime/getRuntime)
                                       (.addShutdownHook
                                         (Thread. (fn [] (fs/delete ".nrepl-port")))))
                                   (deref (promise)))}}

reefersleep 2024-05-08T14:37:40.083189Z

(from our bb.edn)

reefersleep 2024-05-08T14:37:44.653059Z

and it seems to connect fine to that

reefersleep 2024-05-08T14:37:49.463409Z

hm

reefersleep 2024-05-08T15:06:14.594269Z

I made do with that server. Thanks, @sludwig.dev 🙂

reefersleep 2024-05-08T15:06:27.417029Z

Guess I'll have to reboot at some point, and that'll fix my problem, I assume

Samuel Ludwig 2024-05-08T15:19:30.626509Z

👋 , yea the .nrepl-port file not getting cleared on an abnormal exit has bitten me many a timee

Oliver Marshall 2024-05-08T16:01:54.432419Z

FYI @reefersleep, the .nrepl-port file is just where the current port is stored for other tools to pick up on

reefersleep 2024-05-08T18:07:12.889649Z

Cheers @ake

reefersleep 2024-05-08T18:08:04.374349Z

One of my team mates made that bb.edn. Maybe his setup requires knowing the port.