Fork me on GitHub
#cider
<
2018-08-06
>
samarth03:08:09

I have a clojurescript project using shadow-cljs and I want cider to connect to a node repl. I tried running cider-jack-in-cljs but it throws an error. This is what I see in the Messages buffer: [nREPL] Starting server via /usr/local/bin/npx -d org.clojure/tools.nrepl:0.2.13 -d cider/piggieback:0.3.5 -d refactor-nrepl:2.4.0-SNAPSHOT -d cider/cider-nrepl:0.18.0-SNAPSHOT server... error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: npx: installed 226 in 8.863s command not found: server error in process sentinel: Could not start nREPL server: npx: installed 226 in 8.863s command not found: server

samarth03:08:39

I think it’s trying to run the command npx server but I want it to run something like npx shadow-cljs node-repl. Any ideas how to fix this?

bozhidar04:08:13

@samarthkishor1 I think @dpsutton fixed this a while ago. It should actually run npx shadow-cljs server.

bozhidar05:08:22

@bherrmann As CIDER simply runs clj I can’t imagine how this can be some CIDER-specific problem. Likely if you start the server using the same command that CIDER does you’ll get a similar result.

dpsutton05:08:30

@samarthkishor1 this should be fixed. can you try upgrading CIDER and seeing if you it works for you then? If not file an issue with some particulars and I can correct that codepath. It's also not too difficult if you want to dive in yourself

bozhidar06:08:16

@thheller I’ve issued cider-nrepl 0.18 just now. Hopefully this makes your life easier. 🙂

👍 4
dominicm08:08:06

@bozhidar I'm getting middleware descriptor errors with cider-nrepl 0.18 & the included cider/nrepl 0.4.4

dominicm08:08:31

Hmm, eval failed with Exception in thread "nREPL-worker-0" java.lang.ClassCastException: cider.nrepl.middleware.track_state$make_transport$reify__11014 cannot be cast to nrepl.transport.Transport too

bozhidar09:08:33

@dominic Let me see your deps and how are you starting the server.

dominicm09:08:29

clj -A:dev -Sdeps '{:deps {refactor-nrepl {:mvn/version "2.4.0-SNAPSHOT"} cider/cider-nrepl {:mvn/version "0.18.0"} }}' -e '(require (quote cider-nrepl.main)) (cider-nrepl.main/init [ "refactor-nrepl.middleware/wrap-refactor" "cider.nrepl/cider-middleware"])

bozhidar09:08:47

@dominicm remove refactor-nrepl 🙂

dominicm09:08:59

Oh, I thought you said that had been updated 🙃

bozhidar09:08:11

I did update it on master, but never pushed the updated version, as I didn’t have permissions to do it.

dominicm09:08:47

ah, much better 🙂

bozhidar09:08:28

The end users won’t be bothered by this, but require seems to blow up if you eval this a second time.

dominicm09:08:26

A message about x being already aliased?

dominicm09:08:49

probably not an issue if you use cider-refresh, because that unloads the ns.

bozhidar09:08:56

Yeah, not a big deal. I was just wondering I should not wrap this in some ns-aliases check or something.

bozhidar09:08:24

And this affects only people hacking on the tooling projects, so it’s not a big deal, but it’s an annoyance.

manuel10:08:32

just upgraded CIDER from MELPA. Is it just me or C-c M-n M-n doesn't work any more? It shows a spinner next to REPL[clj] in the mode-line, but the REPL stays on user namespace. Do you want me to file an issue?

manuel10:08:48

I also get nrepl-send-sync-request: Sync nREPL request timed out (op ns-load-all) when doing cider-load-all-project-ns. But maybe that's another issue.

manuel10:08:40

(only 4 namespaces in this project, it's a tiny one)

vinai11:08:18

Starting up CIDER on a cljs node project I started a few weeks back I now get the error Sync nREPL request timed out after selecting figwheel-main

[nREPL] Starting server via /usr/local/bin/clojure -Sdeps '{:deps {org.clojure/tools.nrepl {:mvn/version "0.2.13"} cider/piggieback {:mvn/version "0.3.5"} cider/cider-nrepl {:mvn/version "0.18.0-SNAPSHOT"}}}' -e '(require (quote cider-nrepl.main)) (cider-nrepl.main/init ["cider.nrepl/cider-middleware", "cider.piggieback/wrap-cljs-repl"])'...
[nREPL] server started on 60580
[nREPL] Establishing direct connection to localhost:60580 ...
[nREPL] Direct connection to localhost:60580 established
error in process filter: nrepl-send-sync-request: Sync nREPL request timed out (op clone id 1 time-stamp 2018-08-06 12:54:36.011701000)
error in process filter: Sync nREPL request timed out (op clone id 1 time-stamp 2018-08-06 12:54:36.011701000)
I'm only getting rather old and closed (and it looks like they are different) issues when searching. Any idea what is causing this?

manuel11:08:46

@bozhidar done for both issues 🙂

bozhidar11:08:13

@manuel Can you show us your deps?

bozhidar11:08:38

@vinai You can’t really do this. If you’re using clj you have to use nREPL 0.4. 🙂

bozhidar11:08:53

Remove the nREPL dep, update piggieback to 0.3.8 and this will work.

manuel11:08:54

I posted the deps.edn fcontent in both issues, do you want to copy it here?

vinai11:08:20

@bozhidar thanks, will try it now

bozhidar11:08:49

@manuel Ah, didn’t have time to check the issues, but I assume you’re problem must be something similar. That’s why I asked.

vinai11:08:34

I think CIDER is injecting the nrepl and the piggieback dependencies into the start command itself. How can I update them? Do I need to add them as deps to deps.edn?

bozhidar11:08:27

Ah, sorry. Just update the latest CIDER snapshot then. I certainly changed the injection to use piggieback 0.3.8 earlier today.

vinai11:08:55

How do I update the latest CIDER snapshot? Thank you for the handholding.

bozhidar11:08:36

From the M-x package-list-packages menu.

bozhidar11:08:03

You find cider there, then press u to mark it for upgrade and then x to do the upgrade.

bozhidar11:08:10

Afterwards you have to restart your Emacs.

bozhidar11:08:22

(that’s the standard procedure for all Emacs packages, btw)

vinai11:08:08

Oh yeah - I checked this morning if there was an update and didn't see the snapshot from today. Thanks installing now.

vinai11:08:54

Lots of errors during compilation.. should I ignore them?

bozhidar11:08:37

Errors or warnings? 🙂

bozhidar11:08:50

But yeah, normally you can ignore those.

vinai11:08:52

cider-apropos.el:28:1:Error: Cannot open load file: No such file or directory, sesman-browser
;; lots more of those...
In end of data:
nrepl-client.el:1338:1:Warning: the following functions are not known to be defined:
    cider-format-connection-params, cider--gather-connect-params

bozhidar11:08:26

You’ll have to update the sesman package as well.

bozhidar11:08:34

It’s an internal CIDER dep.

vinai11:08:55

Is there a good way to get cider to recompile?

vinai11:08:19

Remove and reinstall?

vinai12:08:58

seems do do the trick.

vinai12:08:16

Still no luck though, CIDER can't find piggieback

[nREPL] Starting server via /usr/local/bin/clojure -Sdeps '{:deps {org.clojure/tools.nrepl {:mvn/version "0.2.13"} cider/cider-nrepl {:mvn/version "0.18.0"}}}' -e '(require (quote cider-nrepl.main)) (cider-nrepl.main/init ["cider.nrepl/cider-middleware"])'...
[nREPL] server started on 61808
[nREPL] Establishing direct connection to localhost:61808 ...
[nREPL] Direct connection to localhost:61808 established
error in process filter: user-error: Piggieback is not available.  See  for details
error in process filter: Piggieback is not available.  See  for details
in package-list-packages I can see Status: Installed in ‘cider-20180806.728/’

bozhidar12:08:42

Hmm, can’t imagine how this happened. You can just add piggieback your deps.edn as a workaround.

bozhidar12:08:54

Seems now it wasn’t added at all for some reason.

vinai12:08:10

I'm restarting emacs one more time and if that doesn't help I'll add it to the deps

vinai12:08:27

Okay, seems like I'm back in a working state. Adding piggieback to deps.edn worked.

bozhidar12:08:54

I’m just puzzled why it wasn’t auto-injected.

bozhidar12:08:13

Likely that’s some regression from the last batch of changes done by @vspinu.

vinai12:08:17

Anything I can do to help debug?

bozhidar12:08:58

Just file a ticket, please. He was doing some refactoring to the jack-in code and I assume somewhere something went wrong.

vinai12:08:47

Just asking if that is the right repo

vinai12:08:44

Thanks for your help @bozhidar

bozhidar12:08:15

You’re welcome!

Garrett Hopper15:08:10

@bozhidar Using piggieback 0.3.8 doesn't throw any errors, however when I start a cljs repl, it seems like it isn't identified properly (or at least not in the same way it used to be). I'm getting a Stdin: prompt now. I'm starting my cljs repls using figwheel.main/start from a clj REPL.

Mario C.15:08:10

How do I actually run something in the repl? If I enter (+ 1 1) and hit enter I get no input at point

dpsutton15:08:00

@mario.cordova.862 did you have a prompt visible when you started typing?

Mario C.15:08:38

What do you mean? I had user>

Mario C.15:08:46

Okay now it works

dpsutton15:08:52

¯\(ツ)

dpsutton15:08:21

i think i've seen this before and just hitting enter once or twice to get a new prompt knocks the cobwebs out 🙂

Mario C.15:08:39

Its exactly what I did. Smashed enter a good couple times

Mario C.15:08:48

If I load a file with SPC m s b can I just switch to it with (in-ns my.proj)

dpsutton15:08:05

cider-load-buffer-and-switch-to-repl-buffer is my go to. i hit that with a prefix and it loads the buffer and sets the namespace

dpsutton15:08:20

i haven't typed a (in-ns in two years

Mario C.15:08:27

I don't see that in the menu

dpsutton16:08:39

that's the name of the function. in emacs it's C-u C-c M-z. No idea in spacemacs

bja18:08:11

SPC u , s B in spacemacs

bja18:08:10

actually, I kinda think that doesn't work

bja18:08:19

since its bound to an approximation of the function

bja18:08:59

I'm inclined to think this is a bug in spacemacs

bozhidar19:08:34

@dpsutton Seems we forgot to document this one and I completely forgot it existed. 😄

dpsutton19:08:51

ah. it's what i use every single day 🙂

benedek19:08:46

@bozhidar i’ve fixed the conditional requires problem on refactor-nrepl.middleware there are still some test failures and an error as well (both locally and on travis)

benedek20:08:06

also it seems that clojure 1.7 is not supported anymore by orchard i guess, or?

bozhidar20:08:12

Yeah, yeah.

bozhidar20:08:16

That one is easy to fix.

bozhidar20:08:00

I’ve dropped the Clojure 1.7 support everywhere, after seeing that in last State of Clojure it’s usage had gone to around 5% (and this was over 6 months ago).

bozhidar20:08:51

I was planning to update the Travis setup, but had too much other work, so you can safely beat me to it. 🙂

dominicm20:08:30

Time to introduce Orchard to transducers. For no particular reason.

benedek20:08:51

the test failures tho look like incompatibilities between new and old nrepl?

benedek20:08:03

i am just guessing for now