Fork me on GitHub
#cider
<
2019-01-16
>
benedek06:01:04

@macrobartfast i posted the link of the alternative a couple of days ago here

benedek06:01:25

@kwcharllie379 also volunteered to bring this/wrap this up for cider

tatut08:01:27

in CIDER 0.20.0 (package: 20190114.1422) (Oslo) I got a weird exception

ERROR: Unhandled REPL handler exception processing message {:op slurp, :url file:/Users/tatuta/..., :session 3274155d-5da6-4885-810a-b45cce1567eb, :id 164}
java.lang.NullPointerException
	at java.util.regex.Matcher.getTextLength(Matcher.java:1283)
	at java.util.regex.Matcher.reset(Matcher.java:309)
	at java.util.regex.Matcher.<init>(Matcher.java:229)
	at java.util.regex.Pattern.matcher(Pattern.java:1093)
	at clojure.core$re_matcher.invokeStatic(core.clj:4796)
	at clojure.core$re_find.invokeStatic(core.clj:4838)
	at clojure.core$re_find.invoke(core.clj:4838)
	at cider.nrepl.middleware.slurp$normalize_content_type.invokeStatic(slurp.clj:57)
	at cider.nrepl.middleware.slurp$normalize_content_type.invoke(slurp.clj:52)
	at cider.nrepl.middleware.slurp$slurp_url_to_content_PLUS_body.invokeStatic(slurp.clj:94) 

tatut08:01:03

when a thing I evaluated returned a java.io.File

Karol Wójcik08:01:30

@benedek it might take some time since I’m also graduating and changing job this month

benedek08:01:06

no pressure and good luck with all those things

bozhidar09:01:23

@tatut Likely you’ve hit some bug in the content-type middleware. You should file a bug and disable this in the mean time.

bozhidar09:01:38

(setq cider-repl-use-content-types nil)

tatut09:01:09

It seems to crash if it can’t determine a content-type

tatut09:01:03

I locally patched get-file-content-type to return “application/octet-stream” as a fallback and it works (but I get a binary file output to my repl which is not useful)

bozhidar09:01:15

@arohner Which version did you upgrade from? Nothing has really changed there recently.

bozhidar09:01:07

What you describe sounds like some missing Elisp autoloads, that should not be happening if you’re using package.el.

bozhidar09:01:40

@tatut Well, probably in such cases we should just return the regular printed value, as would be the case in the absence of the middleware.

bozhidar09:01:02

If you can do this patch yourself that’d be great - if not you can just open a ticket on cider-nrepl and we’ll get to it at some point.

tatut09:01:28

I’ll try after work… I’d like to get into cider/nrepl internals more

Sampo Toiva10:01:55

Hi, I just updated Cider to 0.20.0, and when doing cider-jack-in-clj I get two warnings:

WARNING: CIDER requires nREPL 0.4.4 (or newer) to work properly
WARNING: CIDER requires cider-nrepl to be fully functional. Many things will not work without it!
I have removed all refences to nrepl and cider-nrepl from .lein/profiles.clj, and the cider-jack-in-clj seems to be injecting the dependencies correctly. My messages have these kind of errors:
error in process filter: user-error: ‘nil’ requires the nREPL op "classpath"
Any idea on what's wrong or how could I debug this further?

bozhidar11:01:27

@sampo.toiva I assume you’re on Lein 2.8.1, right?

bozhidar11:01:40

You need 2.8.3+ for the new CIDER to work normally.

Sampo Toiva11:01:05

@bozhidar Your assumption was correct. Things are working perfectly now! Thanks a ton for this! I don't know if it's possible to somehow give a proper error message about that, but it's maybe worth considering.

bozhidar11:01:35

There’s some check about this in cider-nrepl, but I guess that message ended up in the *nrepl-server* buffer.

Sampo Toiva11:01:46

Ah, yeah, didn't occur to me to check that buffer - went through the others.

bozhidar11:01:56

Yeah, the situation is certainly not ideal. Probably we should just try to get the version of Lein/Boot when when cider-nrepl loads and send it to the clients.

pjstadig11:01:55

I put a comment here https://github.com/clojure-emacs/cider-nrepl/issues/460. In cider 0.20 I'm still experiencing the problem where the debugger only uses a breakpoint once.

chrisblom13:01:54

is there a way to clear the cider repl output programmatically?

chrisblom13:01:24

from within clojure

erwinrooijakkers14:01:59

@chrisblom you might be able to run (cider-repl-clear-buffer) by using clomacs (“Clomacs simplifies calling Clojure code from Emacs lisp and vice versa”) https://github.com/clojure-emacs/clomacs

chrisblom14:01:50

@erwinrooijakkers thanks, that might work

macrobartfast17:01:27

@benedek thanks for the link for a strategy for hot reloading deps yesterday! tools.deps looks similar to alembic. that's helpful... although I really liked the idea of being able to both add a dep to project.clj and hot reload it via emacs bindings, so hopefully that issue will get worked out (wish I were good enough yet to tackle it!).

benedek17:01:49

tbh i don't think the client code needs to change much. only the refactor-nrepl impl needs to rewritten in cider-nrepl

arohner18:01:21

Hi there, when running 0.20.0, stacktraces no longer print in my repl buffer, and the stacktrace window no longer appears. I’m also seeing `Warning: implicit middleware found: cider-nrepl.plugin/middleware Please declare all middleware in :middleware as implicit loading is deprecated.` which could be related, but I’m not sure where the middleware it’s complaining about is coming from, there’s nothing that stands out in my ~/.lein/profiles or the project.clj

dpsutton19:01:05

standard question to ask is if you are on lein version 2.8.3. CIDER no longer plays nice with tools.nrepl but needs the newer nrepl/nrepl

arohner19:01:39

$ lein --version
Leiningen 2.8.3 on Java 1.8.0_144 Java HotSpot(TM) 64-Bit Server VM

arohner19:01:38

and running [nrepl "0.5.3"] according to lein deps :tree

dpsutton19:01:51

one thing that just helped out others: putting deps.edn files allows for others to target branches of piggieback, nrepl quite easily. Someone is trying out a patch to piggieback trivially because i pushed a branch with a deps edn file. Just for consideration going forward

cjohansen21:01:51

I'm having problems running figwheel-main with deps.edn in CIDER

cjohansen21:01:28

when I run cider-jack-in-cljs, the browser pops up, figwheel reports being connected, but the mini buffer just hangs with "Starting server via"

cjohansen21:01:48

if I do list-processes I can see the nrepl process running as expected, but I never see a working REPL in emacs

cjohansen21:01:52

anyone seen this?

cjohansen21:01:02

clojure -A:dev from a shell works just fine

dpsutton21:01:34

check the nrepl process in emacs. I think i've seen this before. you probably have the repl running there rather than in the proper repl buffer

cjohansen21:01:24

Prompt will show when REPL connects to evaluation environment (i.e. a REPL hosting webpage)
Figwheel Main Controls:
          (figwheel.main/stop-builds id ...)  ;; stops Figwheel autobuilder for ids
          (figwheel.main/start-builds id ...) ;; starts autobuilder focused on ids
          (figwheel.main/reset)               ;; stops, cleans, reloads config, and starts autobuilder
          (figwheel.main/build-once id ...)   ;; builds source one time
          (figwheel.main/clean id ...)        ;; deletes compiled cljs target files
          (figwheel.main/status)              ;; displays current state of system
Figwheel REPL Controls:
          (figwheel.repl/conns)               ;; displays the current connections
          (figwheel.repl/focus session-name)  ;; choose which session name to focus on
In the cljs.user ns, controls can be called without ns ie. (conns) instead of (figwheel.repl/conns)
    Docs: (doc function-name-here)
    Exit: :cljs/quit
 Results: Stored in vars *1, *2, *3, *e holds last exception object
Opening URL 
ClojureScript 1.10.439
cljs.user=> 

cjohansen21:01:57

but this doesn't really help me. I can't use it for anything. How can I get it to start the regular cider buffer?

dpsutton21:01:40

no you can't. i'm trying to remember what i did in this case

dpsutton21:01:40

check your dir locals. it needs to ask you for the cljs repl type. i remember when it doesn't this happens

cjohansen21:01:00

it doesn't ask, so maybe that's it

dpsutton21:01:08

sorry its been a few weeks but i'm trying to remember

cjohansen21:01:11

((nil
  (cider-clojure-cli-global-options . "-A:dev")))

cjohansen21:01:01

hmm, ok. it might be because of this in my deps.edn:

cjohansen21:01:03

:main-opts ["-m" "figwheel.main" "-b" "dev" "-r"]

dpsutton21:01:17

yeah. move that into a build profile and try without that

cjohansen21:01:48

sort of progress:

cjohansen21:01:57

it now starts a CIDER REPL, but it crashes with some syntax errors and drops into a clj repl

cjohansen21:01:44

2. Caused by clojure.lang.LispReader$ReaderException
   java.lang.RuntimeException: Invalid token: :
   #:clojure.error{:line 1, :column 52}
...
1. Caused by java.lang.RuntimeException
   Invalid token: :

cjohansen21:01:59

ok, seems to be an error on my side

cjohansen21:01:06

alright, thanks a log @dpsutton!