calva

knotschi 2025-11-17T16:54:29.310569Z

weird, when I try to start the repl (jack-in in a deps.edn project), I get the following:

⚡️ Starting the REPL ⚡️ using the below command line:
(cd /home/knotschi/rpm/rpm-system/etl; clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version,"0.3.0"},cider/cider-nrepl {:mvn/version,"0.1.0-SNAPSHOT"}}}' -M:dev -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]")
Execution error (FileNotFoundException) at clojure.main/main (main.java:40).
Could not locate nrepl/cmdline__init.class, nrepl/cmdline.clj or nrepl/cmdline.cljc on classpath
this used to work a few weeks ago, not sure what has changed. anyone an idea what I am doing wrong? 🤷‍♂️

knotschi 2025-11-18T11:51:35.687089Z

If I remove this setting it is using again these old nrepl versions, so I need this setting in there

pez 2025-11-18T11:53:16.995869Z

Thanks. With removed settings. What do you find in the Calva says output channel about these dependencies?

☝️ 1
knotschi 2025-11-18T11:58:15.979049Z

aha:

Calva is utilizing cider-nrepl and clojure-lsp to create this VS Code experience.
  Latest available nREPL dependency versions known by Calva:
    nrepl: 0.3.0
    cider-nrepl: 0.1.0-SNAPSHOT
    cider/piggieback: 0.2.3-SNAPSHOT

  nREPL dependency versions:
    nrepl: effective 0.3.0 (latest known by Calva)
    cider-nrepl: effective 0.1.0-SNAPSHOT (latest known by Calva)
    cider/piggieback: effective 0.2.3-SNAPSHOT (latest known by Calva)
  clojure-lsp version configured: latest

😲 1
knotschi 2025-11-18T11:59:31.937359Z

Calva version used: v2.0.540
clojure-lsp version used: 2025.08.25-14.21.46
clj-kondo version used: 2025.07.28

pez 2025-11-18T11:59:37.350339Z

So, that’s a bug for sure.

👍 1
pez 2025-11-18T11:59:51.947089Z

Super strange!

pez 2025-11-18T12:00:55.051099Z

And super extra strange that it happens for you, but not for me. Cursor is of course a suspect, but still…

knotschi 2025-11-18T12:01:04.798329Z

I can't say for sure if this is a bug I have only since newest version, or I always had it and solved it in the past by specifying these versions in my config

knotschi 2025-11-18T12:01:07.727899Z

let me try with vsc

knotschi 2025-11-18T12:02:18.533679Z

ah, yes, in vsc its better:

Calva is utilizing cider-nrepl and clojure-lsp to create this VS Code experience.
  Latest available nREPL dependency versions known by Calva:
    nrepl: 1.5.1
    cider-nrepl: 0.58.0
    cider/piggieback: 0.6.1

pez 2025-11-18T12:02:37.984619Z

It is probably not the same problem that you may have had in the past. The whole thing works quite differently now.

👍 1
pez 2025-11-18T12:03:32.893039Z

Will you have time to look at it, @arthurfucher? If it is as easy to repro as trying with Cursor, I guess we at least have something to start with…

2025-11-18T12:04:01.201509Z

I'll check with Cursor here

pez 2025-11-18T12:05:33.133189Z

Cool. Let me know if I can help. I think that if we can conclude that it is a Cursor thing, we can create an issue and put the workaround there. We should create the issue anyway, of course.

2025-11-18T12:06:09.358239Z

Hmmm not able to reproduce in Cursor:

Calva is utilizing cider-nrepl and clojure-lsp to create this VS Code experience.
  Latest available nREPL dependency versions known by Calva:
    nrepl: 1.5.1
    cider-nrepl: 0.58.0
    cider/piggieback: 0.6.1

2025-11-18T12:07:28.050979Z

@knotschi can you try to run this command inside Cursor terminal, please?

clj -X:deps find-versions :lib nrepl :n 1

knotschi 2025-11-18T12:11:22.615739Z

clj -X:deps find-versions :lib nrepl :n 1
Execution error (NullPointerException) at java.util.regex.Matcher/getTextLength (Matcher.java:1808).
Cannot invoke "java.lang.CharSequence.length()" because "this.text" is null

pez 2025-11-18T12:13:54.284049Z

What version of the Clojure CLI do you have in that terminal? And what version in VSC proper?

knotschi 2025-11-18T12:14:48.483139Z

Clojure CLI version 1.11.1.1113

knotschi 2025-11-18T12:15:01.279849Z

it might be this bug: https://clojure.atlassian.net/browse/TDEPS-245

pez 2025-11-18T12:15:38.645559Z

Nice find!

knotschi 2025-11-18T12:16:28.535929Z

clj -X:deps find-versions :lib nrepl/nrepl :n 1 works

knotschi 2025-11-18T12:16:44.788389Z

clj -X:deps find-versions :lib nrepl/nrepl :n 1
{:mvn/version "0.3.0"}
{:mvn/version "0.3.1"}
{:mvn/version "0.4.0"}
{:mvn/version "0.4.1"}
{:mvn/version "0.4.2"}
{:mvn/version "0.4.3-SNAPSHOT"}
{:mvn/version "0.4.3"}
{:mvn/version "0.4.4-SNAPSHOT"}
{:mvn/version "0.4.4"}
{:mvn/version "0.4.5-SNAPSHOT"}
{:mvn/version "0.4.5"}
{:mvn/version "0.5.0-SNAPSHOT"}
{:mvn/version "0.5.0"}
{:mvn/version "0.5.1"}
{:mvn/version "0.5.2"}
{:mvn/version "0.5.3"}
{:mvn/version "0.6.0-SNAPSHOT"}
{:mvn/version "0.6.0"}
{:mvn/version "0.6.1-SNAPSHOT"}
{:mvn/version "0.7.0-alpha1"}
{:mvn/version "0.7.0-alpha2"}
{:mvn/version "0.7.0-alpha3"}
{:mvn/version "0.7.0-beta1"}
{:mvn/version "0.7.0-SNAPSHOT"}
{:mvn/version "0.7.0"}
{:mvn/version "0.8.0-alpha1"}
{:mvn/version "0.8.0-alpha2"}
{:mvn/version "0.8.0-alpha3"}
{:mvn/version "0.8.0-alpha4"}
{:mvn/version "0.8.0-alpha5"}
{:mvn/version "0.8.0-SNAPSHOT"}
{:mvn/version "0.8.0"}
{:mvn/version "0.8.1"}
{:mvn/version "0.8.2"}
{:mvn/version "0.8.3"}
{:mvn/version "0.9.0-beta1"}
{:mvn/version "0.9.0-beta2"}
{:mvn/version "0.9.0-beta3"}
{:mvn/version "0.9.0-beta4"}
{:mvn/version "0.9.0-beta5"}
{:mvn/version "0.9.0-SNAPSHOT"}
{:mvn/version "0.9.0"}
{:mvn/version "1.0.0-SNAPSHOT"}
{:mvn/version "1.0.0"}
{:mvn/version "1.1.0-alpha1"}
{:mvn/version "1.1.0"}
{:mvn/version "1.1.1"}
{:mvn/version "1.1.2"}
{:mvn/version "1.2.0-beta1"}
{:mvn/version "1.2.0-beta2"}
{:mvn/version "1.2.0"}
{:mvn/version "1.3.0-beta1"}
{:mvn/version "1.3.0-beta2"}
{:mvn/version "1.3.0-beta3"}
{:mvn/version "1.3.0-beta4"}
{:mvn/version "1.3.0"}
{:mvn/version "1.3.1"}
{:mvn/version "1.4.0"}
{:mvn/version "1.5.0-alpha1"}
{:mvn/version "1.5.0-alpha2"}
{:mvn/version "1.5.0-SNAPSHOT"}
{:mvn/version "1.5.0"}
{:mvn/version "1.5.0-loadfile-SNAPSHOT"}
{:mvn/version "1.5.1"}

pez 2025-11-18T12:16:45.373539Z

So that means we can fix it by qualifying the lib symbols?

knotschi 2025-11-18T12:20:29.056249Z

looks like it

knotschi 2025-11-18T12:22:00.418789Z

don't know why my VSC finds the newer versions though

knotschi 2025-11-18T12:24:50.159129Z

should I update my clj and check if it works then, to double check if this clj version is the issue?

pez 2025-11-18T12:27:44.659779Z

So, you reach the same version also in VSC?

pez 2025-11-18T12:28:55.108409Z

The same version of clj, I mean.

knotschi 2025-11-18T12:29:11.970509Z

if you mean in this terminal here, then yes

pez 2025-11-18T12:30:56.530419Z

To my experience even the VS Code integrated terminal doesn’t tell the full truth about which version Calva will use. What do you get in an external terminal?

knotschi 2025-11-18T12:31:11.262879Z

same

knotschi 2025-11-18T12:32:01.722439Z

I think this terminal there is pretty much exactly the same as my external terminal. Its both using my zshell

pez 2025-11-18T12:34:18.955449Z

I think maybe that Calva prints the clojure version to the console at start. You find the dev tools in the VS Code Help menu.

pez 2025-11-18T12:35:35.452029Z

My current theory is that Calva in VS Code doesn’t find clojure and falls back on the deps.clj uberjar. While Cursor finds your old version.

knotschi 2025-11-18T12:37:16.416999Z

[Extension Host] clojure version: 1.11.1.1113
in VSC but in cursor I cannot find this in the devtools at all

pez 2025-11-18T12:38:04.553489Z

Ah, so I can’t incorporate that in my current model of the universe, but let’s see what happens if I think about it some more. 😃

pez 2025-11-18T12:39:36.555799Z

So VSC finds the version of clojure that is supposed to have the bug… Wow. Maybe Cursor devtools have some default filter?

pez 2025-11-18T12:42:55.899029Z

If you have the time, @knotschi, please file an issue about this. There are probably more people running up against it and it’s good for them to find the issue and the workaround info.

✅ 1
knotschi 2025-11-18T12:48:35.206199Z

I restarted both again. Still, same output in the VSC devtools, but nothing like it in cursor

pez 2025-11-18T12:51:05.438359Z

It is very strange that you don’t see this logging in Cursor.

2025-11-18T12:53:37.892789Z

yeah, here also.. none of the logs are showing in the console at DevTools for Cursor. Just for VSC, as the image...

pez 2025-11-18T13:05:44.494399Z

I now also tried with Cursor. No logging from Calva at all in the console…

pez 2025-11-18T13:09:57.304399Z

I didn’t expect to experience the old “10% of the work to implement a feature, 90% to make it work in all browsers” with a VS Code extension, but here we are. 😃

😂 1
😄 1
knotschi 2025-11-18T13:31:52.920009Z

https://github.com/BetterThanTomorrow/calva/issues/2964

🙏 1
knotschi 2025-11-18T14:06:49.829769Z

btw, updating clj cli to 1.12.3.1577 did not help

knotschi 2025-11-18T14:07:11.736669Z

but this works fine now:

clj -X:deps find-versions :lib nrepl :n 1
{:mvn/version "1.5.1"}

pez 2025-11-18T14:11:50.976289Z

I suspect that something in Cursor holds on to some version of the CLI. Could be that a re-install of Cursor fixes it. With VS Code I often get away with using Insiders instead of stable. Dunno if Cursor has something similar.

pez 2025-11-18T14:12:50.029629Z

The VS Code installation can get corrupted. We’ve seen that happen a few times and we’re always very confused.

pez 2025-11-18T14:13:45.530289Z

It’s frustrating that Cursor hides those loggings for us!

knotschi 2025-11-17T16:55:26.442369Z

I don't have any nrepl dependency in my deps.edn file; running the same command in the terminal shows same error; jack-in on a leiningen project works fine

dpsutton 2025-11-17T16:58:32.493669Z

that nrepl version is ancient. i see version 0.4.2 was released in 2018

pez 2025-11-17T16:58:36.126409Z

The versions look funny and ancient.

dpsutton 2025-11-17T16:58:55.600779Z

https://github.com/nrepl/nrepl/releases?page=2 I can’t find a release of that version here. It might go back to the days of the namespace switching from clojure.tools.nrepl

knotschi 2025-11-17T16:58:56.644389Z

yes thats what I thought too 😄

pez 2025-11-17T16:59:17.892199Z

Maybe you have pinned versions in Calva/VS Code settings?

knotschi 2025-11-17T16:59:28.169689Z

let me check

pez 2025-11-17T16:59:56.207529Z

We recently changed Calva around this, so it could well be a bug.

knotschi 2025-11-17T17:08:11.888349Z

I am very confused. Somehow in my user settings I have this:

"calva.jackInDependencyVersions": {
    "nrepl": "1.5.1",
    "cider-nrepl": "0.58.0",
    "cider/piggieback": "0.6.1"
  }
but can't find any place with these ancient versions

pez 2025-11-17T17:08:38.496839Z

So this looks like a bug.

knotschi 2025-11-17T17:08:43.492049Z

but not even sure why I have that there in my user settings ^^

pez 2025-11-17T17:08:47.401869Z

What happens if you remove the settings?

knotschi 2025-11-17T17:10:31.390629Z

same result

knotschi 2025-11-17T17:11:15.734339Z

I also have this in the defaultSettings.json :

// By default Calva Jack-in will inject the latest `nrepl`, etcetera versions when starting the repl. Override this default behaviour by declaring which versions to use here.
	"calva.jackInDependencyVersions": {
		"nrepl": "1.5.1",
		"cider-nrepl": "0.58.0",
		"cider/piggieback": "0.6.1"
	},

dpsutton 2025-11-17T17:11:36.055319Z

i thought json lacked comments?

🤷‍♂️ 1
knotschi 2025-11-17T17:12:53.954079Z

I think its more likely that I messed up somehow my settings then this is a calva bug ^^ probably otherwise more people would complain

knotschi 2025-11-17T17:15:40.869679Z

but no clue how/where I could have changed the nrepl version that calva uses

knotschi 2025-11-17T17:17:10.005339Z

oh wait, I am using cursor, not vscode in vscode it is working fine. ok, then something is wrong with my cursor setup

pez 2025-11-17T17:20:30.002069Z

VS Code settings are JSONC, but still using .json file extension, iiuc.

pez 2025-11-17T17:22:27.583289Z

Seems it can be a difference in Cursor and VS Code that we are unaware of. It’s very strange. But why would it result in thos funny and ancient version. That’s strange to a level of strange hard to comprehend. 😃

knotschi 2025-11-17T17:44:49.033169Z

I fixed it but I am even more confused now. I changed my settings.json by removing the "calva.jackInDependencyVersions" option, which was not solving the issue. Now I added it back, and now it somehow works 😅 I have no clue why my computer is using 0.3.0 if I do not have this in my settings. Can't find any other settings where 0.3.0 is setup 🤷‍♂️ But anyways, it works now. Thanks for the help and the general great work! 🙏👏

pez 2025-11-17T21:29:27.966999Z

Happy that it works. I think it points at a potential bug in Calva, but I guess we will see it again if so. Still curious. what if remove the settings now?