Fork me on GitHub
#cider
<
2021-12-15
>
diego.videco18:12:50

I am trying to cider-jack-in-cljs into a shadow-clj project, but I am getting this error:

"Execution error (NoSuchMethodError) at com.google.javascript.jscomp.deps.ModuleLoader/createRootPaths (ModuleLoader.java:257).\n'java.util.stream.Collector com.google.common.collect.ImmutableSortedSet.toImmutableSortedSet(java.util.Comparator)'\n"
Does anyone have any idea what this may mean? (I can jack-in with calva)

vemv18:12:42

can you see a fuller stacktrace?

diego.videco18:12:21

{:clojure.main/message
 x"Execution error (NoSuchMethodError) at com.google.javascript.jscomp.deps.ModuleLoader/createRootPaths (ModuleLoader.java:257).\n'java.util.stream.Collector com.google.common.collect.ImmutableSortedSet.toImmutableSortedSet(java.util.Comparator)'\n",
 :clojure.main/triage
 {:clojure.error/class java.lang.NoSuchMethodError,
  :clojure.error/line 257,
  :clojure.error/cause
  "'java.util.stream.Collector com.google.common.collect.ImmutableSortedSet.toImmutableSortedSet(java.util.Comparator)'",
  :clojure.error/symbol
  com.google.javascript.jscomp.deps.ModuleLoader/createRootPaths,
  :clojure.error/source "ModuleLoader.java",
  :clojure.error/phase :execution},
 :clojure.main/trace
 {:via
  [{:type java.lang.NoSuchMethodError,
    :message
    "'java.util.stream.Collector com.google.common.collect.ImmutableSortedSet.toImmutableSortedSet(java.util.Comparator)'",
    :at
    [com.google.javascript.jscomp.deps.ModuleLoader
     createRootPaths
     "ModuleLoader.java"
     257]}],
  :trace
  [[com.google.javascript.jscomp.deps.ModuleLoader
    createRootPaths
    "ModuleLoader.java"
    257]
   [com.google.javascript.jscomp.deps.ModuleLoader
    <init>
    "ModuleLoader.java"
    147]
   [com.google.javascript.jscomp.deps.ModuleLoader
    <init>
    "ModuleLoader.java"
    48]
   [com.google.javascript.jscomp.deps.ModuleLoader$Builder
    build
    "ModuleLoader.java"
    139]
   [com.google.javascript.jscomp.deps.ModuleLoader
    <clinit>
    "ModuleLoader.java"
    408]
   [com.google.javascript.jscomp.DiagnosticGroups
    <clinit>
    "DiagnosticGroups.java"
    189]
   [shadow.build.closure__init load nil 77]
   [shadow.build.closure__init <clinit> nil -1]
   [java.lang.Class forName0 "Class.java" -2]
   [java.lang.Class forName "Class.java" 398]

diego.videco18:12:23

Just found out that this is the culprit.

(setq cider-jack-in-dependencies
      (delete-dups
       (append
        lispy-cider-jack-in-dependencies
        cider-jack-in-dependencies)))

diego.videco18:12:50

I had added that because lispy tries to add pomegranate and dynapath dynamically but sometimes it fails. But seems like this is incompatible with cljs projects

vemv18:12:56

funny thing, just this week we completed removing dynapath from cider-nrepl. what does lispy do to require such dynamism anyways? I don't know much about the project but good old paredit.el certainly never needs to inject JVM deps or such :)

diego.videco18:12:36

Honestly all I care is the editing commands, so I think most of this somewhat unnecessary and better provided by cider and other modules

diego.videco18:12:49

but I don't quite know how to disable it yet

vemv21:12:25

Here you can track the logic it follows for conditionally injecting its stuff https://github.com/abo-abo/lispy/blob/e9731aa95581951ab2cbfaed28f0ac7d71124ac0/le-clojure.el#L145-L189 It observes (eq major-mode 'clojurescript-mode) . Maybe when you cider-jack-in-cljs the major mode is clojure-mode instead? You can also just setq lispy-cider-jack-in-dependencies nil , maybe that won't cause an immediate issue if you only use the editing commands

diego.videco23:12:55

thanks for the suggestios, I'll try them out