Fork me on GitHub

Is there a way to make the stack trace more consice when using cider eval preferably filter out/collapse parts of the stack that are not in the src folder or show only a summary?


Check out the "project only" button or hit "p"

👍 4
Daniel Truemper09:12:58

Hi, already asked in #beginners and re-posting here: I have a problem with CIDER and reloading namespaces. I can run the application once but as soon as I reload CIDER complains that it cannot find a certain namespace. I've been reading "Reloading Woes" ( and trying to find out the problem but to no help. Does anyone have a hint at the source of the problem?


Does CIDER have an ability to highlight compilation errors in the code buffer? I see some references to this in the issues, but I don't think it ever worked for me.


That’s one of the oldest features and it always worked for me. 😄


Alright, maybe it's Boot-related. This should work by default, right?


Could you hint at the Emacs function I should debug?


Try cider-extract-error-info in cider-eval.el.


Basically we just parse the exceptions that happen after eval, extract the location info for the error from them and highlight the offending line.


I think this was the very first commit I made to CIDER. 😄 (nrepl.el at the time)


Interesting. I was wrong that it doesn't work for me at all – e.g. reflection warnings are underlined yellow in the buffer. But I don't think I've ever seen red underlines.


It looks like on compilation errors (failed to compile) Emacs never enters cider-extract-error-info but it does on warnings.


I've observed that in the past and I don't understand how it can happen


On startup though


I also haven't seen red underlines in a long time, IIRC I just get an exception buffer pop up when compilation fails

👍 4

Do you use Leiningen or something else?


mostly tools.deps (clojure cli) these days


Interesting! I restarted the REPL, and it looks like each new stacktrace op message adds another pprint-fn, print-length, and print-level.


However, that doesn't seem to be related to the error highlight problem.


@dpsutton noticed this problem a while ago. I never had time to debug it, but it seemed like something harmless. It’s unrelated to what you’re experiencing.


can someone tell me what does this error mean?

Could not start nREPL server: WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by mranderson048.orchard.v0v3v0.dynapath.v0v2v5.dynapath.defaults$eval3309$fn__3310 to method
WARNING: Please consider reporting this to the maintainers of mranderson048.orchard.v0v3v0.dynapath.v0v2v5.dynapath.defaults$eval3309$fn__3310
This happens after doing cider-jack-in. Also when doing lein repl on my terminal the process fails and this is printed:
REPL server launch timed out.


you're running on Java 10 or 11 right?


java -version
java version "1.8.0_161"
Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)


(one minute, I'm on a call)


no prob 😉


The warnings are not the problem, it must be something else.


Take a closer look at your log, I assume there’s no more info there.


yeah, the repl its timing out for some reason. Is there a way I can debug lein repl?


is there anything in the *nrepl-server* buffer?


if lein repl fails i don't think there is any hope of CIDER starting your project.


you can also go to *Messages* and find the command that CIDER uses to launch nrepl, then run that in the terminal


this sounds like a problem with your project, not CIDER. if you can't get a repl up with lein repl this isn't some bug that CIDER introduces


> the repl its timing out for some reason maybe it's loading a namespace that blocks for some reason? do you have a user.clj?


yep, it was an infinite loop i had in a file

😁 8

@truemped did you figure out your issue?

Daniel Truemper16:12:52

@dpsutton No, unfortunately not. @cfeckardt gave me some feedback but in theory everything looks fine. I checked further and in the reply I see that c.t.n.r/refresh lists the namespace but somehow does not seem to find it.


ah. so does this seem to be an issue with your project outside of CIDER?

Daniel Truemper16:12:43

I'm really not sure. I do think it must be on my side (it usually is...) but I don't see the one thing that is wrong.


from a blank repl can you require each namespace individually?

Daniel Truemper17:12:44

I'm on my way home. Will try later. What is interesting is that initially it works. Only after I run either c.t.n.r/refresh or (cider-refresh) things don't work anymore

Daniel Truemper20:12:51

Hm, so yes, I cannot require the namespace even on a freshly started repl session.


what's up with the namespace. can you figure out a repro of this issue that others can see?

Daniel Truemper20:12:46

I'll copy the repo into a private Gitlab one.

Daniel Truemper21:12:31

You don't happen to have a Gitlab account?


i sure don't


but i also don't have time to clone your project. can you poke around the forms and see which ones are preventing your namespace from loading?

Daniel Truemper21:12:17

so, let me copy what I have

Daniel Truemper21:12:54

this is the error I see: clojure.lang.Compiler$CompilerException: java.lang.Exception: No namespace: felicity-lemon.config, compiling:(felicity_lemon/joining_streams.clj:1:1)

Daniel Truemper21:12:33

this is the ns declaration in joining_streams.clj:

Daniel Truemper21:12:35

(ns felicity-lemon.joining-streams
  (:require [taoensso.timbre :as log]

            [metrics.meters :refer (meter mark!)]
            [metrics.gauges :refer (gauge-fn)]

            [jackdaw.streams :as j]
            [jackdaw.serdes.json :as jsj]

            [felicity-lemon.config :refer (config)]

  (:import (felicity_lemon.kafka_streams.serde JsonSerde)
           (felicity_lemon.kafka_streams.metrics MetricsBridge)
           (org.apache.kafka.streams KafkaStreams)
           (org.apache.kafka.streams KafkaStreams$StateListener)
           (org.apache.kafka.streams KafkaStreams$State)
           (org.apache.kafka.common.serialization Serde Serdes)))


ok. can you find the felicity-lemon/config.clj file and try eval'ing it and see what happens


is this clojurescript by any chance?

Daniel Truemper21:12:05

... starting a repl

Daniel Truemper21:12:38

(ns felicity-lemon.config
   [taoensso.timbre :refer (info merge-config!)]
   [cprop.core :as cprop]
   [cprop.source :as cp-src]
   [mount.core :refer (defstate)]
   [clojure.string :as str]
   [metrics.core :refer (new-registry)]

   [clojure.spec.alpha :as spec]
   [felicity-lemon.specs :as cs]))


ok. well the error message is saying it doesn't know what felicity-lemon.config is. so start there


can you eval that file?

Daniel Truemper21:12:36

what do you mean by "eval that file"? I'm in the repl and have all stuff loaded. I can run (start) and it starts my API with felicity-lemon.config evaluated and running


and you're sure that config is required and loaded when you evaluate (start)?

Daniel Truemper21:12:52

yes, it adapts the configuration, i.e. listens on a different port depending on the config, e.g.

Daniel Truemper21:12:07

only when I reload ...

Daniel Truemper21:12:53

felicity-lemon.repl> (start)
18-12-10 21:22:32 daniels INFO [felicity-lemon.core:42] - Starting server on port 8080
{:started ["#'felicity-lemon.config/config-merges" "#'felicity-lemon.config/config" "#'felicity-lemon.core/mgmt-server" "#'felicity-lemon.config/joiners"]}


nothing stands out to me sorry

Daniel Truemper21:12:18

thank you anyways. Once I found the issue, this will be a very big aha! for me 🙂


Hey all. I'm trying to have cider work with deps.edn and I'm having trouble evaluating anything except simple forms such as (+ 1 2). Is the current workflow to create a new alias for your dev? If so. I'm having trouble determining which dependencies to include. It also seems that opening a repl in my terminal doesn't necessarily open a port along with it for cider to connect to?


@petr are you using aliases in your app's deps.edn?


I am. I also have some defined inside my .clojure/deps.edn. Are we able to specify which profiles to load from cider, or do we need to start the repl from teh terminal?


as in, in order to start your app for development it needs to run with a certain alias to include paths/deps/etc.


:nrepl {:extra-deps {nrepl {:mvn/version "RELEASE"}}
          :main-opts ["-e" "(require,'[nrepl.server,:refer,[start-server]]),(start-server,:port,60606)"]}
^^ Stolen from sean's gh


if you're using cider-jack-in, you can specify different params to the command by pressing C-u before the cider-jack-in


it should come up with an nREPL server command prompt which you can add e.g. -A:dev to


cider-jack-in will add all of the nREPL dependencies and start the server like you have in the alias, though, so you shouldn't need that


in a lot of my deps.edn projects now, I add a .dir-locals.el file to configure the way cider starts my app's REPL:


in that project, I have dependencies and source paths defined in both a :server alias and a :dev alias that I want to include when I jack in


This is great, thank you