This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-06-29
Channels
- # announcements (10)
- # babashka (18)
- # beginners (136)
- # calva (9)
- # cider (14)
- # clara (12)
- # clj-kondo (32)
- # cljsrn (3)
- # clojure (133)
- # clojure-europe (21)
- # clojure-nl (4)
- # clojure-uk (15)
- # clojurescript (60)
- # conjure (40)
- # cursive (12)
- # datomic (6)
- # emacs (2)
- # fulcro (19)
- # jackdaw (25)
- # jobs-discuss (3)
- # kaocha (3)
- # leiningen (5)
- # off-topic (99)
- # pedestal (1)
- # re-frame (49)
- # reagent (4)
- # ring (5)
- # rum (5)
- # shadow-cljs (53)
- # spacemacs (2)
- # sql (13)
- # timbre (2)
- # tools-deps (23)
- # vim (11)
- # xtdb (7)
when I cider-jack-in-clj+cljs into a figwheel-main project and try and reload namespaces with clojure.tools.namespace.repl/refresh (http://e.g.as triggered by integrant.repl/reset) I get the following exception:
[{:type clojure.lang.Compiler$CompilerException
:message "Syntax error compiling at (figwheel/repl.cljc:1372:5)."
:data #:clojure.error{:phase :compile-syntax-check, :line 1372, :column 5, :source "figwheel/repl.cljc"}
:at [clojure.lang.Compiler analyzeSeq "Compiler.java" 7115]}
{:type java.lang.ClassNotFoundException
:message "cljs.stacktrace"
:at [java.net.URLClassLoader findClass "URLClassLoader.java" 471]}]
this doesn't happen if I cider-jack-in-clj and cider-jack-in-cljs separately. is cider-jack-in-clj+cljs not recommended for figwheel-main if you're going to use clojure.tools.namespace.repl/refresh? am I missing out on anything by not being able to use the same session for both?
just in case someone else runs into the same problem, I worked around it by restricting the set of directories that clojure.tools.namespace.repl/refresh will traverse (a good idea anyway):
(ns user
(:require
[clojure.java.classpath :as cp]
[clojure.string :as str]
[clojure.tools.namespace.repl :as nsrepl]))
(apply nsrepl/set-refresh-dirs
(for [root (cp/classpath-directories)
:when (and (or (str/starts-with? root "dev/")
(str/starts-with? root "src/"))
(not (str/includes? root "/cljs/"))
(not (str/ends-with? root "/cljs")))
f (file-seq root)
:when (.isDirectory f)]
f))
(don't C+P this code blindly since it's tailored to the directory structure of my project; the important part is filtering out cljs directories)
Hello! What is an idiomatic way to limit the amount of printing of exceptions that reach the cider repl from other threads? I can use alter-var-root to make them restrict print-length as well but is there a better way?
But you should have your logging under control- so you can limit or filter certain messages
Right, for a sensible application I would do it, but it is troublesome while just prototyping things in the REPL.
@dpsutton I updated the reference page for CIDER configuration variables, adding the descriptions https://practicalli.github.io/spacemacs/reference/cider/configuration-variables.html
I used the output you posted in slack and a bit of vim editing magic. I tightened up the wording a little in places