is there a way to start a new clojure-lsp.out
file ?
You can delete it, or open it and delete all contents.
a new one will be created if you delete
oke, should I then place the whole contents on the issue ?
Does anyone here use shadow-cljs with Windows and WSL2? If so, you may be able to help @roelof with this issue: https://github.com/BetterThanTomorrow/calva/issues/984
That would be helpful
Just the contents from a single startup, so close VS Code, delete the file/contents, then open the project that was giving the issue
I'm using shadow-cljs with WSL2. I think he needs to specify source-paths in shadow-cljs.edn: {:source-paths ["src"] ,,, } The error isn't complaining about shadow-cljs not being installed. It's about not finding the src files, I think.
Hmm, perhaps you're right, but that's defined already, according to the linked repo in the issue
Is he accessing his project through the WSL extension of VSCode? In my setup, shadow-cljs, npm, etc., are all installed in Ubuntu/WSL2, not in Windows. Calva is installed as under the WSL:Ubuntu section of VSCode extensions. And everything just works.
@roelof ^
yes, see here
and clojure, npm and so all are also all installed on WSL2
done that already and add it to the issue
You could try cloning this repository: https://github.com/agoldhammer/lexy I'm working with this right now on WSL2 with Calva. See if it gives you the same type of error.
same error @agold
OK, I’m out of ideas. Sorry and good luck.
NP thanks for the effort
@brandon.ringe should I try to install node, npm and clojure-cljs on Windows ? What you asked on the issue
It's worth a try, node and shadow-cljs* I think you mean. It would allow us to maybe rule out the possibility that your system is trying to run it on windows and not wsl2
What happens if you run shadow-cljs compile app at the command line in your project directory?
@agold what do you mean exacltly
From a terminal, run shadow-cljs compile app
from your project directory
I mean cd into your project directory and type “shadow-cljs compile app” at the prompt.
Then I see this :
shadow-cljs compile app
shadow-cljs - config: /home/roelof/learn-reagent-course-files/giggin/shadow-cljs.edn
[:app] Compiling ...
[:app] Build completed. (116 files, 0 compiled, 0 warnings, 5.12s)
which looks fine to me
Yes, that’s what’s expected. Maybe trying asking @theller.
does this look well
npm install --save-dev shadow-cljs
npm WARN saveError ENOENT: no such file or directory, open 'C:\Users\rwobb\package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\rwobb\package.json'
npm WARN rwobb No description
npm WARN rwobb No repository field.
npm WARN rwobb No README data
npm WARN rwobb No license field.
+ shadow-cljs@2.11.14
added 99 packages from 106 contributors and audited 99 packages in 14.835s
3 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
if so, then it does not solve the problem
still seeing the same error
You want to install it globally - npm install -g shadow-cljs
Then make sure from powershell you can run shadow-cljs -h
he, then the error is gone 😢
So it works now, no error?
no error
Ok, the good news is it works, and we know clojure-lsp is running shadow-cljs
on Windows and not WSL2. The bad news is I don't know why that's happening 😄
why on earth is it looking on windows
me either
I don’t understand this at all. Clojure-lsp works fine on my setup, and I do not have shadow-cljs installed on Windows, only on Ubuntu/WSL2.
Yeah, really strange..
most wierd that I see now other repl as in other project but the same output as I did yarn run dev
so it looks that shadow-cljs has worked the whole time but then why can calva not find it
Clojure-lsp* rather, is where the call is made. And I'm not sure. I suppose we should wait and see if anyone else experiences the same thing. Let's leave the issue open
oke, I as a beginner have totally noi idea or xp to solve this
It's okay, crowd-sourcing the debugging can be an effective method 😄
we see
I will de-install everything from Windows
and hopes it can be solved soon
he, now I deleted the windows shadow-cljs I see this error when opening a repl
Start the REPL with the command *Start Project REPL and connect (aka Jack-in)*.
Default keybinding for REPL Jack-in: `ctrl+alt+c ctrl+alt+j`
Or connect to a running REPL using `ctrl+alt+c ctrl+alt+c`
Aborting. No valid shadow-cljs build selected.
Try clicking on the nrepl icon in the status bar. This will open a menu at the top listing a choic of builds from which you can select.
yep, there I see only the :app one
That is correct, since that’s the only build you have defined. What happens when you click OK on the right of that menu? Do you get a repl?
chips. I see it . I have to select it
and yep, I see a rep
clj꞉shadow.user꞉> ; Use `alt+enter` to evaluate
; Creating cljs repl session...
; Connecting cljs repl: shadow-cljs...
OK, you’re in business. Now you can evaluate forms in your code by placing cursor in form and pressing Alt-Enter.
I know
still wierd that everyone is finding the shadow-cljs except calva or clojure-lsp
Do you see the build output from shadow-cljs in the Calva terminal window?
in the repl I see this :
; TIPS:
; - You can edit the contents here. Use it as a REPL if you like.
; - `alt+enter` evaluates the current top level form.
; - `ctrl+enter` evaluates the current form.
; - `alt+up` and `alt+down` traverse up and down the REPL command history
; when the cursor is after the last contents at the prompt
; - Clojure lines in stack traces are peekable and clickable.
clj꞉shadow.user꞉> ; Use `alt+enter` to evaluate
; Creating cljs repl session...
; Connecting cljs repl: shadow-cljs...
; The Calva Connection Log might have more connection progress information.
; Connected session: cljs, repl: :app
; TIPS: You can choose which REPL to use (clj or cljs):
; *Calva: Toggle REPL connection*
; (There is a button in the status bar for this)
; Jack-in done.
cljs꞉cljs.user꞉> ; Use `alt+enter` to evaluate
in the terminal output I see this :
npx shadow-cljs -d cider/cider-nrepl:0.25.7 watch :app
shadow-cljs - config: /home/roelof/learn-reagent-course-files/giggin/shadow-cljs.edn
shadow-cljs - HTTP server available at <http://localhost:3000>
shadow-cljs - server version: 2.11.14 running at <http://localhost:9630>
shadow-cljs - nREPL server started on port 3333
shadow-cljs - watching build :app
[:app] Configuring build.
[:app] Compiling ...
[:app] Build completed. (195 files, 0 compiled, 0 warnings, 5.51s)
That’s not the terminal window. That’s the output window. Click terminal in the bottom pane (or control-J if it’s not showing).
the last one schould be it
that one respons on control-j
this one
npx shadow-cljs -d cider/cider-nrepl:0.25.7 watch :app
shadow-cljs - config: /home/roelof/learn-reagent-course-files/giggin/shadow-cljs.edn
shadow-cljs - HTTP server available at <http://localhost:3000>
shadow-cljs - server version: 2.11.14 running at <http://localhost:9630>
shadow-cljs - nREPL server started on port 3333
shadow-cljs - watching build :app
[:app] Configuring build.
[:app] Compiling ...
[:app] Build completed. (195 files, 0 compiled, 0 warnings, 5.51s)
That's it. So Calva has indeed found shadow-cljs, which compiled your code. There is no problem with finding shadow-cljs, as you see clearly in the terminal window.
yep, so still a wierd thing that I also see the message that shadow-cljs is not found. That is why i has made that issue
since I de-install node and so on on Windows I still see this screen
so it more and more making no sense at all
I can’t help with that. You will need one of the Calva devs. But it seems to me that that message has nothing to do with whether shadow-cljs or Calva is installed on Windows or WSL. It’s a problem with the classpath that clojure-lsp is using.
one question
where is shadow-cljs installed on your computer
for me here
/home/roelof/.yarn/bin/shadow-cljs
It’s /usr/bin/shadow-cljs
So, from the perspective of VS Code and Calva, shadow-cljs is found. However, it seems from the perspective of clojure-lsp, which runs as a separate process that Calva spawns, shadow-cljs is being run on Windows, where it's not found. I'm not sure why this is the case for you though and not @agold
Maybe it’s got to do with the fact that he’s got shadow-cljs installed in a subdir of his home directory rather than in /usr/bin as on my system. I installed with npm -g. He seems to have used yarn.
yep
that is it
Eureka!
when i copie shadow-cljs to /usr/bin the popup does not appear
Haha I was actually starting to type out a message to try npm install -g
tried now 2 times and 2 times no screen 🎉
Awesome, will note in the issue and I think it can be closed
so yarn is too blame
https://github.com/clojure-lsp/clojure-lsp/issues/271 Also opened this issue to try to make this less of an issue
will now use npm for installing
Did you use yarn global
when you added shadow before?
Right, I think the issue is not npm vs. yarn but global vs. local
I doubt it
I know for sure I added that to my .bashrc
export PATH="$(yarn global bin):$PATH"
Hmm, yeah idk enough off hand to know that that would be sufficient
and after adding that I installed shadow-cljs
time to sleep here
both thanks a lot
No problem!
and as I said I will use npm and check where thinsg are instaleld
cannot check where yarn is now installing things
Thanks for the reinforcements to the Calva support, @agold! ❤️