This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-09-08
Channels
- # announcements (40)
- # babashka (14)
- # babashka-sci-dev (7)
- # beginners (50)
- # calva (8)
- # cider (25)
- # clj-kondo (7)
- # cljdoc (8)
- # cljs-dev (14)
- # clojars (6)
- # clojure (56)
- # clojure-australia (1)
- # clojure-berlin (2)
- # clojure-dev (16)
- # clojure-europe (18)
- # clojure-nl (1)
- # clojure-norway (5)
- # clojure-uk (7)
- # clojurescript (100)
- # cursive (57)
- # data-science (9)
- # datomic (6)
- # emacs (11)
- # figwheel (2)
- # fulcro (14)
- # helix (2)
- # hyperfiddle (9)
- # introduce-yourself (1)
- # lsp (20)
- # malli (14)
- # meander (34)
- # minecraft (1)
- # missionary (8)
- # off-topic (37)
- # pedestal (4)
- # polylith (18)
- # portal (3)
- # re-frame (5)
- # ring (33)
- # shadow-cljs (32)
- # spacemacs (6)
- # vim (16)
Hi, I updated Cursive to the latest version today and I get an error when trying to open a remote nREPL to a local Shadow-CLJS runtime:
Exception starting REPL: java.lang.IllegalStateException: Could not open new session; :clone response: Disconnected from remote server.
Do you have an idea where the problem comes from and how to work around it?
I don’t, sorry. Perhaps try asking in #shadow-cljs, and if you don’t get anywhere there I’ll look at it tomorrow morning.
It was working before I update intellij and cursive.
Yes, the Clojure one
I don't know which version exactly, but I know that it was the latest intellij and cursive version I was able to use with my license expired on March 23th. I renewed the license this morning.
The project is not public.
I didn't find such file. When shadow-cljs (2.19.5) is not running and I try to connect a repl from the IDE using "Use standard port file", I get a different error from the IDE in a notification bubble saying "Cannot find port from port file". So I guess it is not a problem with a lingering port file. for info, when shadow-cljs is running:
$ ls .shadow-cljs
babel-worker cli-repl.port jar-manifest server.pid socket-repl.port
builds http.port nrepl.port server.token
I also have this – i updated Cursive first, and then a couple days later upgraded CLJS and Shadow to
org.clojure/clojurescript {:mvn/version "1.11.60"}
thheller/shadow-cljs {:mvn/version "2.20.1"}
at which point i believe i got the error. Found this thread by global search, I did not suspect Cursive. Sitting down now to try to triangulateOk, on Cursive 1.12.5-eap1-2022.1, Cursive Clojure Local REPL, nREPL, Run With Deps, on startp a .nrepl-port is produced in project root.
Starting nREPL server...
WARNING: compile already refers to: #'clojure.core/compile in namespace: user, being replaced by: #'user/compile
Connecting to local nREPL server...
Clojure 1.11.1
nREPL server started on port 56232 on host localhost -
Immediately - now Cursive Remote REPL, nrepl, use port from REPL file in project ..., use standard port file:
Connecting to remote nREPL server...
Clojure 1.11.1
Close remote REPL
Now when I run
(def shadow-start! (delay @(requiring-resolve 'shadow.cljs.devtools.server/start!)))
(@shadow-start!)
output is now:
Starting nREPL server...
WARNING: compile already refers to: #'clojure.core/compile in namespace: user, being replaced by: #'user/compile
Connecting to local nREPL server...
Clojure 1.11.1
nREPL server started on port 56232 on host localhost -
(@shadow-start!)
shadow-cljs - server version: 2.20.1 running at
shadow-cljs - nREPL server started on port 9001
=> :shadow.cljs.devtools.server/started
additionally, a second .nrepl-port file is produced shadow-cljs/.nrepl-port
Cursive Remote REPL, autodetect port:
Connecting to remote nREPL server...
Exception starting REPL: java.lang.IllegalStateException: Could not open new session; :clone response: Disconnected from remote server.
Clojure and Shadow version doesn't impact this, I can repro these steps with the following two configurations:
org.clojure/clojurescript {:mvn/version "1.11.60" #_"1.11.4"}
thheller/shadow-cljs {:mvn/version "2.20.1" #_"2.18.0"}
Explicitly setting the CLJS nrepl port to shadow-cljs/.nrepl-port obviously fixes the error
Did the autodetect rules change or did the generation of the file change in either Cursive or Shadow recently? Not sure why this is suddenly happening or where the bug is or if there even is a bug
Thanks for the repro information, I’ll try to repro that today. I don’t think the autodetect rules have changed recently. Thomas might know if shadow’s generation of port files has changed, although it seems like maybe a change to nREPL is generating the .nrepl-port rather than Shadow doing it.
however I upgraded to nrepl 1.0 and didn't check what it is doing in those regards
Ok I will check again now, maybe I didn't cleanly test when i reverted back to 2.18.0
Just to be clear, it looks like you’re starting the Shadow REPL using a Cursive nREPL config rather than on the command line, correct?
Um i am calling shadow.cljs.devtools.server/start! from cursive Local repl to start shadow's nrepl
this results in two running nrepl services, one from the Cursive local repl and one from Shadow – which I did not realize I was doing until today
So in that case, I’d expect to see what you’re seeing in terms of port files. Starting the nREPL server via the Cursive nREPL config will create .nrepl-port, and Shadow’s nREPL will create .shadow-cljs/.nrepl-port. However I don’t think any of that has changed in a long time, and it shouldn’t cause an error obviously.
However my impression is that Vincent wasn’t doing that, since he said he didn’t find an .nrepl-port file.
Carefully testing with shadow-cljs "2.18.0" (rm -rf .shadow-cljs && rm .nrepl-port) and I still repro - i can see the Cursive Local REPL create .nrepl-port within a few seconds of startup
i dont think a shadow 2.20 change is in play
I have this error too, but in my case neither of the options result in a running repl I suspect it's because I want to connect to a shadow repl inside wsl2 from windows
moved from wsl2 to just using git bash and I am here https://gist.github.com/ashnur/9264574919de333e463e591a9fcba008 Not even sure where to look after this. Will have to try with a different editor.
Cursive 1.12.5-eap1 - 2022-08-03 Add ability for socket REPL to pick up the port from a file #2695
Hello cursivians 👋 !
I actually do have the same issue after upgrading to Cursive 1.12.7-2022.3 with IntelliJ IDEA 2022.3.2 (CE).
My nREPL is started by an external process and puts a file .nrepl-port
at project source root. My setting Edit Configurations > Remote REPL > Use port from REPL file > Us_e standard port file_ no longer works and produces:
2023-01-31 17:35:50,752 [ 93130] SEVERE - #cursive.repl.nrepl - Error reading from nREPL client
java.lang.ArithmeticException: long overflow
at java.lang.Math.multiplyExact (Math.java:1004)
clojure.lang.Numbers.multiply (Numbers.java:1971)
nrepl.bencode$read_long.invokeStatic (bencode.clj:129)
nrepl.bencode$read_long.invokePrim (bencode.clj:-1)
nrepl.bencode$read_long.invokeStatic (bencode.clj:127)
nrepl.bencode$read_long.invokePrim (bencode.clj:-1)
nrepl.bencode$read_long.invokeStatic (bencode.clj:127)
nrepl.bencode$read_long.invokePrim (bencode.clj:-1)
nrepl.bencode$read_long.invokeStatic (bencode.clj:127)
nrepl.bencode$read_long.invokePrim (bencode.clj:-1)
nrepl.bencode$read_netstring_STAR_.invokeStatic (bencode.clj:156)
nrepl.bencode$read_netstring_STAR_.invoke (bencode.clj:154)
nrepl.bencode$read_token.invokeStatic (bencode.clj:247)
nrepl.bencode$read_token.invoke (bencode.clj:237)
nrepl.bencode$read_bencode.invokeStatic (bencode.clj:257)
nrepl.bencode$read_bencode.invoke (bencode.clj:254)
nrepl.transport$bencode$fn__4147$fn__4148.invoke (transport.clj:113)
when I try to run the REPL from Cursive.@U0567Q30W I haven’t been able to start a Cursive nREPL client due to this issue for a while. I thought it was an issue with our configuration until I saw this thread. Steps to reproduce:
1) start a ShadowCLJS app in the terminal, which also automatically starts an nREPL server and creates an nrepl.port
file (among others) under .shadow-cljs
directory (which is .gitignore
d and Excluded, if that helps)
2) start a Cursive remote nREPL client and select "Use standard port file" under “Use port from REPL file”
Switching to “Specify custom port file” and providing .shadow-cljs/.nrepl-port
fix the problem.
I saw that Crusive now lists .shadow-cljs/nrepl|socket-repl.port
in the repl remote dialog? could be that it tries the socket-repl.port even though nrepl is selected?
as I mentioned above, switching to manually specifying the port file fixes the problem within same nREPL Run Configuration.
Switching to Socket REPL starts a REPL just fine as ShadowCLJS starts a socket REPL server and creates the port file for it as well.
Something seems off with the combination of nREPL, ShadowCLJS, and the automatic port file detection.
This was reported as https://github.com/cursive-ide/cursive/issues/2759, and is fixed for the next build. I’ll try to get this out today. My apologies for this taking so long.
I don't know if this is Cursive thing or an IntelliJ thing but is there a way to make project structure > modules
default to excluded
for all subfolders ? I'm pretty sure IntelliJ eagerly indexes everything not exluded in there, including folders like .cpcache, .git, .circleci etc
this may or may not help, but I've found if you open the .gitignore in intellij in recent versions it will ask you if you want to add everything there into excluded folders
though I can't say I've seen intellij indexing the .git folder myself
this may help: https://www.jetbrains.com/help/idea/creating-and-registering-file-types.html#ignore-files-folders
thanks but that tells IntelliJ to totally ignore those files/folders, i.e. they won't even appear in the project view, whereas I still want to see some such folders in the project view, but I want them excluded from indexing