Fork me on GitHub
#calva
<
2021-01-25
>
roelof17:01:15

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

bringe17:01:09

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

bringe17:01:22

a new one will be created if you delete

roelof17:01:03

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

bringe17:01:37

That would be helpful

bringe17:01:00

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

roelof18:01:36

done that already and add it to the issue

👍 1
bringe17:01:14

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

agold17:01:03

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.

bringe17:01:37

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

agold18:01:02

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.

roelof18:01:41

yes, see here

roelof18:01:11

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

agold18:01:49

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.

agold18:01:54

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

roelof18:01:13

NP thanks for the effort

roelof18:01:50

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

bringe18:01:25

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

agold18:01:35

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

roelof18:01:19

@U2CR1J4UV what do you mean exacltly

bringe18:01:13

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

agold18:01:19

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

roelof18:01:49

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)

roelof18:01:57

which looks fine to me

agold18:01:28

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

roelof19:01:13

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.

+ [email protected]
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

roelof19:01:50

if so, then it does not solve the problem

roelof19:01:58

still seeing the same error

bringe19:01:13

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

bringe19:01:53

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

roelof19:01:59

he, then the error is gone 😢

bringe19:01:18

So it works now, no error?

bringe19:01:56

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 😄

roelof19:01:57

why on earth is it looking on windows

agold19:01:03

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.

bringe19:01:05

Yeah, really strange..

roelof19:01:29

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

roelof19:01:42

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

bringe19:01:17

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

roelof19:01:32

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

bringe19:01:45

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

roelof19:01:47

I will de-install everything from Windows

👍 1
roelof19:01:41

and hopes it can be solved soon

roelof19:01:38

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.

agold19:01:10

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.

roelof19:01:56

yep, there I see only the :app one

agold19:01:52

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?

roelof19:01:44

chips. I see it . I have to select it

roelof19:01:11

and yep, I see a rep

roelof19:01:26

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

agold19:01:31

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

roelof19:01:31

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

agold19:01:00

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

roelof19:01:36

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

roelof19:01:07

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 
shadow-cljs - server version: 2.11.14 running at 
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)

agold19:01:58

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

roelof20:01:35

the last one schould be it

roelof20:01:54

that one respons on control-j

roelof20:01:35

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 
shadow-cljs - server version: 2.11.14 running at 
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)

agold20:01:30

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.

roelof20:01:37

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

roelof20:01:44

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

roelof20:01:59

so it more and more making no sense at all

agold20:01:28

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.

roelof20:01:49

one question

roelof20:01:05

where is shadow-cljs installed on your computer

roelof20:01:01

for me here

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

agold20:01:06

It’s /usr/bin/shadow-cljs

bringe20:01:27

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 @U2CR1J4UV

agold20:01:18

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.

roelof20:01:13

that is it

roelof20:01:41

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

bringe20:01:12

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

roelof20:01:25

tried now 2 times and 2 times no screen 🎉

bringe20:01:36

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

roelof20:01:40

so yarn is too blame

bringe20:01:53

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

roelof20:01:52

will now use npm for installing

bringe20:01:30

Did you use yarn global when you added shadow before?

agold20:01:02

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

roelof20:01:17

I doubt it

roelof20:01:54

I know for sure I added that to my .bashrc

roelof20:01:31

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

bringe20:01:59

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

roelof20:01:32

and after adding that I installed shadow-cljs

roelof20:01:49

time to sleep here

roelof20:01:37

both thanks a lot

bringe20:01:49

No problem!

roelof20:01:31

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

roelof20:01:15

cannot check where yarn is now installing things

pez22:01:04

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

❤️ 1
👍 1