https://github.com/BetterThanTomorrow/calva/issues/1049 You may find some info here helpful
Thank you @brandon.ringe Iโm going to be following this.
Trying to open the get started repl on windows and seeing this error.
java -jar ".calva\deps.clj.jar" -Sdeps "{:deps {nrepl/nrepl {:mvn/version,""0.8.3""},cider/cider-nrepl {:mvn/version,""0.25.11""}}}" -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]"
Error while parsing option "--config-data {:deps {nrepl/nrepl {:mvn/version,0.8.3},cider/cider-nrepl {:mvn/version,0.25.11}}}": java.lang.NumberFormatException: Invalid number: 0.8.3
Jack-in process exited. Status: 1
I click nREPL in the bottom bar.
Click Fire up the "Getting started" REPL
Click use Existing Temp Directory
The REPL Output window shows:
; Jacking in...
; Starting Jack-in Terminal: java -jar ".calva\deps.clj.jar" -Sdeps "{:deps {nrepl/nrepl {:mvn/version,""0.8.3""},cider/cider-nrepl {:mvn/version,""0.25.11""}}}" -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]"
THen the terminal shows the error:
java -jar ".calva\deps.clj.jar" -Sdeps "{:deps {nrepl/nrepl {:mvn/version,""0.8.3""},cider/cider-nrepl {:mvn/version,""0.25.11""}}}" -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]"
Error while parsing option "--config-data {:deps {nrepl/nrepl {:mvn/version,0.8.3},cider/cider-nrepl {:mvn/version,0.25.11}}}": java.lang.NumberFormatException: Invalid number: 0.8.3
Jack-in process exited. Status: 1
Calva is v2.0.194
that "Error while parsing option "--config-data {:deps {nrepl/nrepl {:mvn/version,0.8.3}, ..." looks like the "" is not escaping and just getting removed so it's trying to parse 0.8.3 as a number in the data
Something I have wrong possibly in a config file or something?
well it's something to do with quoting/escaping of the command line for sure
I didn't think the getting started repl used things in my project, i thought it was standalone
Tried in a different proejct, and same error. Yet that same project I can connect to a normal repl fine. hmmm
I have the exact same problem. I was inspired to try calva after a presentation Pez had a couple of days ago. It looks like it is an issue with powershell. It is only affecting a few people.
I found this issue : https://github.com/BetterThanTomorrow/calva/issues/387
Haven't had time to look into it yet.
it would probably be useful to know which version of the clojure cli is installed
clojure --version
will work on newer versions (`clojure -Sdescribe` on older if that doesn't work)
Clojure CLI version 1.10.2.796
If I go to nREPL in toolbar, then click "Start your project with a REPL Server and connect (aka jack-in)" Then choose Leinegen (since this project is a project.clj project) It works fine and I get a repl The terminal for this says
cmd.exe /d /c lein update-in :dependencies conj [nrepl,"0.8.3"] -- update-in :plugins conj [cider/cider-nrepl,"0.25.11"] -- update-in [:repl-options,:nrepl-middleware] conj '["cider.nrepl/cider-middleware"]' -- repl :headless
nREPL server started on port 19008 on host 127.0.0.1 - <nrepl://127.0.0.1:19008>
Seems just to be the getting started repl
We will probably never see the end of quoting issues with powershell. ๐ @borkdude and I was at it for weeks straight and it seemed we had it nailed. BTW, the getting started REPL is special. It uses a bundled jar of deps.clj
and not the โofficialโ CLI tools.
@qmstuart can you report an issue on Calva from within VS Code? Then it will attach some system info.
How, do I do this? Do you mean this window?
@pez I have the same issue. How do I report this in VS Code?
@pez This doesn't seem an issue with deps.clj itself but with how your tool is calling the jar? > java -jar ".calva\deps.clj.jar" -Sdeps "{:deps {nrepl/nrepl {:mvn/version,""0.8.3""},cider/cider-nrepl {:mvn/version,""0.25.11""}}}" -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]"
where is the code that calls this jar?
When shelling out to something on Windows there's usually some escaping that needs to be done for quotes. Are you shelling out from JS/node?
@borkdude I didnโt mean to imply that it was a problem in deps.clj. Yes, shelling out from node. Yes, I know there is quoting going on. Tell me about it. ๐ I might have spent a couple of msn months on it in total.
@pez The "standard" fix I usually apply is this one: https://github.com/babashka/process/blob/eba04e6c35814296e5bb383804f801aee912cba1/src/babashka/process.clj#L152
This is usually needed when args are JSON or EDN (because of embedded strings)
I might try it. Don't want to break it everywhere it works though.
Only apply this on Windows
Haha, yes, of course. But it works on every windows machine I can bring up.
I even bought a machine, remember? ๐
I bumped into that quoting issue setting up Calva for a colleague. I don't have a Windows machine handy so I can't test, but one workaround is to modify the "Jack In Dependency Versions" Calva setting such that every value in the PowerShell invocation is triple-quoted.
At least, that's what worked on my colleague's machine. :man-shrugging::skin-tone-2:
That is, e.g. {:mvn/version """0.8.3"""}
etc.
Awesome. Thanks for sharing!
You mean this?
I get same error ๐
java -jar ".calva\deps.clj.jar" -Sdeps "{:deps {nrepl/nrepl {:mvn/version,"""0.8.3"""},cider/cider-nrepl {:mvn/version,"""0.25.11"""}}}" -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]"
Error while parsing option "--config-data {:deps {nrepl/nrepl {:mvn/version,0.8.3},cider/cider-nrepl {:mvn/version,0.25.11}}}": java.lang.NumberFormatException: Invalid number: 0.8.3
Jack-in process exited. Status: 1
bloody windows huh ๐
You must json quote the quotes there.
Yeah, still same problem. Tried single quotes, double quotes, triple quotes
If you get a potential fix for it, let me know I can help you test it
I'll take you up on that offer, @qmstuart. It's invaluable to have a machine where we can reproduce.
Meanwhile, two things.
1. Maybe try with borkdude's backslash quoting as well? And all things on that command line are not equal so pay close attention to what param the error messages complain about. Then you'll need to add all quoting together. ๐
2. If it is mainly the getting started REPL you want to try out, and you have the CLI tools set up. You can fork and clone the dram
repository and jack in to it with the regular command.
I could check the exact format next week, but I realize thatโs a bit late... anyway, the objective is to try to convey the triple quotes into the command-line invocation.
Oh, I see now that that did happen. No idea why that doesnโt work, then. :man-shrugging::skin-tone-2:
This all depends whether you are invoking this yourself from a shell, or if Calva is invoking this from node. In the latter case this doesn't have to do anything with your shell.
So please give a good repro with a lot of details, else I don't think it's actionable.
Please give this some :calva: emojies, dear friends. (In the #news-and-articles channel).
@borkdude I think all these attempts have been using the Calva Getting Started REPL command. The super strange and extra tricky thing here is that it behaves so differently on different WIndows machines.
For now, I take the win that @flowthing highlights here. That there is at least some workarounds possible by the fact that the injected dependencies are configurable via settings.
java -jar ".calva\deps.clj.jar" -Sdeps "{:deps {nrepl/nrepl {:mvn/version,"""0.8.3"""},cider/cider-nrepl {:mvn/version,"""0.25.11"""}}}" -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]"
That doesn't work because of the nested double quotes, right?So maybe -Sdeps '{:deps ,,,}'
might work (single quotes).
Or no, not in PowerShell maybe... don't remember.
yeah, I don't think single quotes are what you want in powershell
Yeah.
I'll check the exact invocation Calva makes on my colleague's laptop next week.
Single quotes do work in PowerShell. Use them as follows: -Sdeps '{:deps {medley/medley {:mvn/version \"1.3.0\"}}}'
cc @flowthing
Note that the double quotes have to be escaped.