cider

Allen Hai 2025-05-19T19:29:59.833249Z

hey folks! when trying to jack-in to a cljs repl (shadow-cljs), I get the following error:

[nREPL] Starting server via /Users/coetry/.nvm/versions/node/v21.7.3/bin/npx shadow-cljs -d nrepl/nrepl:1.3.1 -d cider/cider-nrepl:0.55.7 -d cider/piggieback:0.5.3 server
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: shadow-cljs - config: /Users/coetry/Hacks/Clojure/uix/shadow-cljs.edn
shadow-cljs - starting via "clojure"
Execution error (FileNotFoundException) at clojure.main/main (main.java:40).
Could not locate shadow/cljs/devtools/cli__init.class, shadow/cljs/devtools/cli.clj or shadow/cljs/devtools/cli.cljc on classpath.

Full report at:
/var/folders/40/cnzkzgvs2xnbz7pvhkmnkl2r0000gn/T/clojure-14696336758868201331.edn
 ("exited abnormally with code 1")
error in process sentinel: Could not start nREPL server: shadow-cljs - config: /Users/coetry/Hacks/Clojure/uix/shadow-cljs.edn
shadow-cljs - starting via "clojure"
Execution error (FileNotFoundException) at clojure.main/main (main.java:40).
Could not locate shadow/cljs/devtools/cli__init.class, shadow/cljs/devtools/cli.clj or shadow/cljs/devtools/cli.cljc on classpath.

Allen Hai 2025-05-19T19:30:25.170759Z

shadow-cljs is available in my path

Allen Hai 2025-05-19T19:30:43.076299Z

any ideas on how to debug further?

dpsutton 2025-05-19T19:37:28.229169Z

what does /var/folders/40/cnzkzgvs2xnbz7pvhkmnkl2r0000gn/T/clojure-14696336758868201331.edn say?

Allen Hai 2025-05-19T19:38:57.666999Z

{:clojure.main/message
 "Execution error (FileNotFoundException) at clojure.main/main (main.java:40).\nCould not locate shadow/cljs/devtools/cli__init.class, shadow/cljs/devtools/cli.clj or shadow/cljs/devtools/cli.cljc on classpath.\n",
 :clojure.main/triage
 {:clojure.error/class java.io.FileNotFoundException,
  :clojure.error/line 40,
  :clojure.error/cause
  "Could not locate shadow/cljs/devtools/cli__init.class, shadow/cljs/devtools/cli.clj or shadow/cljs/devtools/cli.cljc on classpath.",
  :clojure.error/symbol clojure.main/main,
  :clojure.error/source "main.java",
  :clojure.error/phase :execution},
 :clojure.main/trace
 {:via
  [{:type java.io.FileNotFoundException,
    :message
    "Could not locate shadow/cljs/devtools/cli__init.class, shadow/cljs/devtools/cli.clj or shadow/cljs/devtools/cli.cljc on classpath.",
    :at [clojure.lang.RT load "RT.java" 482]}],
  :trace
  [[clojure.lang.RT load "RT.java" 482]
   [clojure.lang.RT load "RT.java" 444]
   [clojure.core$load$fn__6931 invoke "core.clj" 6189]
   [clojure.core$load invokeStatic "core.clj" 6188]
   [clojure.core$load doInvoke "core.clj" 6172]
   [clojure.lang.RestFn invoke "RestFn.java" 411]
   [clojure.core$load_one invokeStatic "core.clj" 5961]
   [clojure.core$load_one invoke "core.clj" 5956]
   [clojure.core$load_lib$fn__6873 invoke "core.clj" 6003]
   [clojure.core$load_lib invokeStatic "core.clj" 6002]
   [clojure.core$load_lib doInvoke "core.clj" 5981]
   [clojure.lang.RestFn applyTo "RestFn.java" 145]
   [clojure.core$apply invokeStatic "core.clj" 669]
   [clojure.core$load_libs invokeStatic "core.clj" 6044]
   [clojure.core$load_libs doInvoke "core.clj" 6028]
   [clojure.lang.RestFn applyTo "RestFn.java" 140]
   [clojure.core$apply invokeStatic "core.clj" 669]
   [clojure.core$require invokeStatic "core.clj" 6066]
   [clojure.main$main_opt invokeStatic "main.clj" 515]
   [clojure.main$main_opt invoke "main.clj" 511]
   [clojure.main$main invokeStatic "main.clj" 665]
   [clojure.main$main doInvoke "main.clj" 617]
   [clojure.lang.RestFn applyTo "RestFn.java" 140]
   [clojure.lang.Var applyTo "Var.java" 707]
   [clojure.main main "main.java" 40]],
  :cause
  "Could not locate shadow/cljs/devtools/cli__init.class, shadow/cljs/devtools/cli.clj or shadow/cljs/devtools/cli.cljc on class

dpsutton 2025-05-19T19:39:54.991169Z

well that’s not much help. Is shadow-cljs on your classpath?

dpsutton 2025-05-19T19:40:04.935389Z

it’s looking for a namespace from it. do you have that?

Allen Hai 2025-05-19T19:40:37.062959Z

i have it in my deps.edn

{:deps {org.clojure/clojure {:mvn/version "1.12.0"}
        org.clojure/clojurescript {:mvn/version "1.11.60"}
        com.pitch/uix.core {:mvn/version "1.4.3"}
        com.pitch/uix.dom {:mvn/version "1.4.3"}}
 :paths ["src"]
 :aliases {:dev {:extra-deps {thheller/shadow-cljs {:mvn/version "2.28.19"}
                              binaryage/devtools {:mvn/version "1.0.7"}}}}}

dpsutton 2025-05-19T19:41:52.652409Z

if you move that from extra deps into regular deps does it work? that would help diagnose if you are not getting dev aliases to shadow somehow. this lets us know that if you successfully get the dev alias to it it should work. then you can back it out and figure out how to pass alias information around

Allen Hai 2025-05-19T19:43:11.933079Z

yeah that works

Allen Hai 2025-05-19T19:43:48.009039Z

but i get this warning in the repl

Execution error (ExceptionInfo) at shadow.cljs.devtools.server.nrepl/shadow-cljs-repl (nrepl.clj:33).
shadow-cljs nREPL initialization failure!
Your nREPL client sent a wrong parameter. A keyword specifying the build-id is expected.
Instead got a #cljs.repl.browser.BrowserEnv{:es #object[java.util.concurrent.ThreadPoolExecutor 0x2c589ced "java.util.concurrent.ThreadPoolExecutor@2c589ced[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]"], :browser-state #atom[{:return-value-fn nil, :client-js nil}], :working-dir ".repl-1.11.60", :preloaded-libs [], :launch-browser true, :static-dir ["." "out/"], :src "src/", :port 9000, :ordering #agent[{:expecting nil, :fns {}}], :host "localhost", :server-state #atom[{:socket nil, :listeners 0}]}

dpsutton 2025-05-19T19:43:59.827489Z

no idea on that one

Allen Hai 2025-05-19T19:44:11.982049Z

got it, wonder why my dev alias isn’t firing properly

Allen Hai 2025-05-19T19:46:36.838109Z

{:deps true
 :dev-http {8080 "public"}
 :builds {:app
          {:target :browser
           :modules {:main {:entries [app.core]
                            :init-fn app.core/init}}
           :devtools {:preloads [uix.preload devtools.preload]}}}}

Allen Hai 2025-05-19T19:46:56.861179Z

that’s my shadow-cljs.edn its a minimal starter template, not much going on there

dpsutton 2025-05-19T19:47:23.812229Z

i think you can include alias informatoin there

dpsutton 2025-05-19T19:48:08.854149Z

{:deps {:aliases [:cljs]}
 :builds ...}

Allen Hai 2025-05-19T19:58:04.653359Z

shadow-cljs.edn

{:deps {:aliases [:dev]}
 :dev-http {8080 "public"}
 :builds {:app
          {:target :browser
           :modules {:main {:entries [app.core]
                            :init-fn app.core/init}}
           :devtools {:preloads [uix.preload]}}}}
deps.edn
{:deps {org.clojure/clojure {:mvn/version "1.12.0"}
        org.clojure/clojurescript {:mvn/version "1.11.60"}
        com.pitch/uix.core {:mvn/version "1.4.3"}
        com.pitch/uix.dom {:mvn/version "1.4.3"}}
 :paths ["src"]
 :aliases {:dev {:extra-deps {thheller/shadow-cljs {:mvn/version "2.28.19"}
                              binaryage/devtools {:mvn/version "1.0.7"}}}}

Allen Hai 2025-05-19T19:58:32.342659Z

does that look correct? Still getting problems with that config, it only works if i put it under main :deps

dpsutton 2025-05-19T19:58:47.332319Z

I’d suggest getting this all working without cider tooling. Helps simplify and identify where the issue is

👍 1
Allen Hai 2025-05-19T20:08:13.272539Z

looks like its working now (i ran it in vscode calva and it said i had a parsing error in my deps.edn — fixed it and it works now from cider)

Allen Hai 2025-05-19T20:08:17.760909Z

thanks for your help!

Allen Hai 2025-05-19T20:08:21.758189Z

gratitude

dpsutton 2025-05-19T21:33:16.829369Z

nice!

dpsutton 2025-05-19T21:33:56.919099Z

yeah. CIDER is helpful but when things are working, sometimes it’s hard to get clear error messages since you have docs for shadow-cljs, deps.edn, CIDER, clojure-mode, emacs, etc. removing the middlement for debugging is very helpful