calva

Wednesdays you might find @U0ETXRFEW in the Gather Calva space. Invite is https://gather.town/invite?token=GZqrm7CR and the password is `Be kind`.
roelof 2021-01-25T17:33:15.179200Z

is there a way to start a new clojure-lsp.out file ?

bringe 2021-01-25T17:34:09.179500Z

You can delete it, or open it and delete all contents.

bringe 2021-01-25T17:34:22.179700Z

a new one will be created if you delete

roelof 2021-01-25T17:35:03.181Z

oke, should I then place the whole contents on the issue ?

roelof 2021-01-25T17:35:08.181200Z

@brandon.ringe

bringe 2021-01-25T17:35:14.181400Z

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

bringe 2021-01-25T17:35:37.181600Z

That would be helpful

bringe 2021-01-25T17:36:00.181800Z

Just the contents from a single startup, so close VS Code, delete the file/contents, then open the project that was giving the issue

agold 2021-01-25T17:46:03.182Z

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.

bringe 2021-01-25T17:50:37.182200Z

Hmm, perhaps you're right, but that's defined already, according to the linked repo in the issue

agold 2021-01-25T18:14:02.182600Z

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.

bringe 2021-01-25T18:16:27.182800Z

@roelof ^

roelof 2021-01-25T18:33:41.183Z

yes, see here

roelof 2021-01-25T18:34:11.183400Z

and clojure, npm and so all are also all installed on WSL2

roelof 2021-01-25T18:34:36.183600Z

done that already and add it to the issue

👍 1
agold 2021-01-25T18:37:49.183900Z

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.

roelof 2021-01-25T18:42:10.184200Z

same error @agold

agold 2021-01-25T18:42:54.184400Z

OK, I’m out of ideas. Sorry and good luck.

roelof 2021-01-25T18:43:13.184600Z

NP thanks for the effort

roelof 2021-01-25T18:47:50.184800Z

@brandon.ringe should I try to install node, npm and clojure-cljs on Windows ? What you asked on the issue

bringe 2021-01-25T18:51:25.185Z

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

agold 2021-01-25T18:51:35.185200Z

What happens if you run shadow-cljs compile app at the command line in your project directory?

roelof 2021-01-25T18:52:19.185400Z

@agold what do you mean exacltly

bringe 2021-01-25T18:53:13.185600Z

From a terminal, run shadow-cljs compile app from your project directory

agold 2021-01-25T18:53:19.185800Z

I mean cd into your project directory and type “shadow-cljs compile app” at the prompt.

roelof 2021-01-25T18:54:49.186Z

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)

roelof 2021-01-25T18:54:57.186200Z

which looks fine to me

agold 2021-01-25T18:55:28.186400Z

Yes, that’s what’s expected. Maybe trying asking @theller.

roelof 2021-01-25T19:03:56.186600Z

@brandon.ringe

roelof 2021-01-25T19:04:13.186800Z

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

roelof 2021-01-25T19:04:50.187Z

if so, then it does not solve the problem

roelof 2021-01-25T19:04:58.187200Z

still seeing the same error

bringe 2021-01-25T19:05:13.187400Z

You want to install it globally - npm install -g shadow-cljs

bringe 2021-01-25T19:05:53.187600Z

Then make sure from powershell you can run shadow-cljs -h

roelof 2021-01-25T19:06:59.187800Z

he, then the error is gone 😢

bringe 2021-01-25T19:07:18.188Z

So it works now, no error?

roelof 2021-01-25T19:08:23.188200Z

no error

bringe 2021-01-25T19:08:56.188400Z

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 😄

roelof 2021-01-25T19:08:57.188600Z

why on earth is it looking on windows

roelof 2021-01-25T19:09:07.188800Z

me either

agold 2021-01-25T19:10:03.189Z

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.

bringe 2021-01-25T19:11:05.189200Z

Yeah, really strange..

roelof 2021-01-25T19:11:29.189400Z

most wierd that I see now other repl as in other project but the same output as I did yarn run dev

roelof 2021-01-25T19:12:42.189600Z

so it looks that shadow-cljs has worked the whole time but then why can calva not find it

bringe 2021-01-25T19:14:17.189800Z

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

roelof 2021-01-25T19:15:32.190Z

oke, I as a beginner have totally noi idea or xp to solve this

bringe 2021-01-25T19:18:45.190200Z

It's okay, crowd-sourcing the debugging can be an effective method 😄

roelof 2021-01-25T19:19:01.190400Z

we see

roelof 2021-01-25T19:19:47.190600Z

I will de-install everything from Windows

👍 1
roelof 2021-01-25T19:25:41.190900Z

and hopes it can be solved soon

roelof 2021-01-25T19:32:38.191100Z

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.

agold 2021-01-25T19:45:10.191300Z

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.

roelof 2021-01-25T19:50:56.191500Z

yep, there I see only the :app one

agold 2021-01-25T19:51:52.191700Z

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?

roelof 2021-01-25T19:52:44.191900Z

chips. I see it . I have to select it

roelof 2021-01-25T19:53:11.192100Z

and yep, I see a rep

roelof 2021-01-25T19:53:26.192300Z

clj꞉shadow.user꞉>  ; Use `alt+enter` to evaluate
; Creating cljs repl session...
; Connecting cljs repl: shadow-cljs...

agold 2021-01-25T19:54:31.192500Z

OK, you’re in business. Now you can evaluate forms in your code by placing cursor in form and pressing Alt-Enter.

roelof 2021-01-25T19:54:52.192700Z

I know

roelof 2021-01-25T19:55:31.192900Z

still wierd that everyone is finding the shadow-cljs except calva or clojure-lsp

agold 2021-01-25T19:57:00.193100Z

Do you see the build output from shadow-cljs in the Calva terminal window?

roelof 2021-01-25T19:58:36.193300Z

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

roelof 2021-01-25T19:59:07.193500Z

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)

agold 2021-01-25T19:59:58.193700Z

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).

roelof 2021-01-25T20:00:35.193900Z

the last one schould be it

roelof 2021-01-25T20:00:54.194100Z

that one respons on control-j

roelof 2021-01-25T20:01:35.194300Z

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)

agold 2021-01-25T20:02:30.194500Z

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.

roelof 2021-01-25T20:03:37.194700Z

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

roelof 2021-01-25T20:04:44.194900Z

since I de-install node and so on on Windows I still see this screen

roelof 2021-01-25T20:04:59.195300Z

so it more and more making no sense at all

agold 2021-01-25T20:08:28.195500Z

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.

roelof 2021-01-25T20:09:49.195700Z

one question

roelof 2021-01-25T20:10:05.195900Z

where is shadow-cljs installed on your computer

roelof 2021-01-25T20:11:01.196100Z

for me here

/home/roelof/.yarn/bin/shadow-cljs

agold 2021-01-25T20:13:06.196300Z

It’s /usr/bin/shadow-cljs

bringe 2021-01-25T20:13:27.196500Z

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

agold 2021-01-25T20:15:18.196700Z

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.

roelof 2021-01-25T20:16:08.196900Z

yep

roelof 2021-01-25T20:16:13.197100Z

that is it

agold 2021-01-25T20:16:37.197300Z

Eureka!

roelof 2021-01-25T20:16:41.197500Z

when i copie shadow-cljs to /usr/bin the popup does not appear

bringe 2021-01-25T20:17:12.197700Z

Haha I was actually starting to type out a message to try npm install -g

roelof 2021-01-25T20:17:25.197900Z

tried now 2 times and 2 times no screen 🎉

bringe 2021-01-25T20:17:36.198100Z

Awesome, will note in the issue and I think it can be closed

roelof 2021-01-25T20:17:40.198300Z

so yarn is too blame

bringe 2021-01-25T20:17:53.198500Z

https://github.com/clojure-lsp/clojure-lsp/issues/271 Also opened this issue to try to make this less of an issue

roelof 2021-01-25T20:18:52.198900Z

will now use npm for installing

bringe 2021-01-25T20:19:30.199200Z

Did you use yarn global when you added shadow before?

agold 2021-01-25T20:20:02.199400Z

Right, I think the issue is not npm vs. yarn but global vs. local

roelof 2021-01-25T20:20:17.199600Z

I doubt it

roelof 2021-01-25T20:20:54.200Z

I know for sure I added that to my .bashrc

roelof 2021-01-25T20:21:31.200200Z

export PATH="$(yarn global bin):$PATH"

bringe 2021-01-25T20:21:59.200400Z

Hmm, yeah idk enough off hand to know that that would be sufficient

roelof 2021-01-25T20:24:32.200600Z

and after adding that I installed shadow-cljs

roelof 2021-01-25T20:24:49.200800Z

time to sleep here

roelof 2021-01-25T20:26:37.201Z

both thanks a lot

bringe 2021-01-25T20:26:49.201200Z

No problem!

roelof 2021-01-25T20:27:31.201400Z

and as I said I will use npm and check where thinsg are instaleld

roelof 2021-01-25T20:28:15.201600Z

cannot check where yarn is now installing things

pez 2021-01-25T22:52:04.201800Z

Thanks for the reinforcements to the Calva support, @agold! ❤️

👍 1
❤️ 1