Fork me on GitHub
Eva O19:03:15

I'm trying to run npx shadow-cljs server but I'm running into an error:

shadow-cljs - starting via "clojure"
Execution error (FileNotFoundException) at clojure.main/main (
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:

Eva O19:03:10

The full report:

 "Execution error (FileNotFoundException) at clojure.main/main (\nCould not locate shadow/cljs/devtools/cli__init.class, shadow/cljs/devtools/cli.clj or shadow/cljs/devtools/cli.cljc on classpath.\n",
  :clojure.error/line 40,
  "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 "",
  :clojure.error/phase :execution},
    "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 "" 462]}],
  [[clojure.lang.RT load "" 462]
   [clojure.lang.RT load "" 424]
   [clojure.core$load$fn__6908 invoke "core.clj" 6161]
   [clojure.core$load invokeStatic "core.clj" 6160]
   [clojure.core$load doInvoke "core.clj" 6144]
   [clojure.lang.RestFn invoke "" 408]
   [clojure.core$load_one invokeStatic "core.clj" 5933]
   [clojure.core$load_one invoke "core.clj" 5928]
   [clojure.core$load_lib$fn__6850 invoke "core.clj" 5975]
   [clojure.core$load_lib invokeStatic "core.clj" 5974]
   [clojure.core$load_lib doInvoke "core.clj" 5953]
   [clojure.lang.RestFn applyTo "" 142]
   [clojure.core$apply invokeStatic "core.clj" 669]
   [clojure.core$load_libs invokeStatic "core.clj" 6016]
   [clojure.core$load_libs doInvoke "core.clj" 6000]
   [clojure.lang.RestFn applyTo "" 137]
   [clojure.core$apply invokeStatic "core.clj" 669]
   [clojure.core$require invokeStatic "core.clj" 6038]
   [clojure.main$main_opt invokeStatic "main.clj" 514]
   [clojure.main$main_opt invoke "main.clj" 510]
   [clojure.main$main invokeStatic "main.clj" 664]
   [clojure.main$main doInvoke "main.clj" 616]
   [clojure.lang.RestFn applyTo "" 137]
   [clojure.lang.Var applyTo "" 705]
   [clojure.main main "" 40]],
  "Could not locate shadow/cljs/devtools/cli__init.class, shadow/cljs/devtools/cli.clj or shadow/cljs/devtools/cli.cljc on classpath."}}
I'm using version 2.17.8 for both JS and Clojure. My deps.edn:
{:paths ["src/main", "resources"]
 :deps {org.clojure/clojure {:mvn/version "1.11.0"}
        com.fulcrologic/fulcro {:mvn/version "3.5.15"}
        com.taoensso/timbre {:mvn/version "5.2.1"}}
 :aliases {:dev {:extra-paths ["src/dev"]
                 :extra-deps {org.clojure/clojurescript {:mvn/version "1.11.4"}
                              binaryage/devtools {:mvn/version "1.0.5"}
                              cider/cider-nrepl {:mvn/version "0.28.3"}
                              thheller/shadow-cljs {:mvn/version "2.17.8"}}}}}
My shadow-cljs.edn:
{:deps {:aliases [:dev]}
 :dev-http {8000 "classpath:public"}
 :builds {:main {:target :browser
                 :output-dir "resources/public/js/main"
                 :asset-path "/js/main"
                 :modules {:main {:init-fn quizlet.client/init
                                  :entries [quizlet.client]}}
                 :devtools {:after-load quizlet.client/refresh
                            :preloads [com.fulcrologic.fulcro.inspect.preload


that error you get when shadow-cljs is not on the classpath

Eva O19:03:55

How do I add it to the classpath?


might be some bad cache or maybe the jar download was aborted and is incomplete?


try deleting your .cpcache folder


when that doesn't work delete ~/.m2/repository/thheller/shadow-cljs


otherwise looks fine

Eva O19:03:40

Same error except it also includes WARNING: Specified aliases are undeclared: [:-A]


hmm weird. which OS is this?


this is a regular tools.deps install I assume? maybe thats outdated or broken somehow?

Eva O19:03:05

MacOS 12.2.1


via :deps you are telling shadow-cljs to run tools.deps clojure command. that should be fine but may break if thats not the standard thing

Eva O19:03:33

What is tools.deps?


you can try clojure -A:dev -M -m shadow.cljs.devtools.cli server

Eva O19:03:07

Same error


what is clojure?


what is the clojure command for you?


dunno how you installed it

Eva O20:03:07

Both clojure and clj give the same output

Eva O20:03:26

The weird thing is that it works in other projects. It's just this new one that's breaking


clj -version?


what I have seen before is some not-visible unicode char as the first char in deps.edn


or somewhere else? forgot how to figure that out though

Eva O20:03:50

Execution error (FileNotFoundException) at (
-version (No such file or directory)

Full report at:

Eva O20:03:05

That's what I get when I run clj -version


hmm there is definitely something weird then? might just be super old? I get

$ clj -version
Clojure CLI version


maybe clj -Sdescribe?

Eva O20:03:18

My version is 1.11.0. I checked by just running clj


no, that is the clojure version. not the version of the clj tool itself

Eva O20:03:57

clj -Sdescribe
{:version ""
 :config-files ["/usr/local/Cellar/clojure/" "/Users/eoogbe/.clojure/deps.edn" "deps.edn" ]
 :config-user "/Users/eoogbe/.clojure/deps.edn"
 :config-project "deps.edn"
 :install-dir "/usr/local/Cellar/clojure/"
 :config-dir "/Users/eoogbe/.clojure"
 :cache-dir ".cpcache"
 :force false
 :repro false
 :resolve-aliases ""
 :classpath-aliases ""
 :jvm-aliases ""
 :main-aliases ""
 :all-aliases ""}


hmm yeah that is kinda old


maybe try upgrading that

Eva O20:03:16

I don't remember how I initially installed clojure since it was a long time ago. Since I'm using a Mac, I would assume I did it through brew. However brew upgrade clojure/tools/clojure doesn't work. I'm going to try to reinstall with brew. Hopefully it doesn't clobber it


I'm not sure why it wouldn't work either. maybe try asking in #tools-deps. that error about missing alias is definitely weird


seems declared fine to me but thats the root of the problem it seems


Does anyone know, when used with github actions, shadow-cljs doesn't cache jars that shadow uses, and they keep getting re-downloaded each time. Has anyone dealt with this?

😕 1

you need to setup caching yourself. I don't have a guide for that but I'm sure there is one. regular maven caching will do


trying to use amazon-cognito-identity-js and per the the table here I wrote

(ns presentation.cognito.auth
  (:require ["amazon-cognito-identity-js" :refer (CognitoUserPool)]))
but whenever i try to use CognitoUserPool it says its an undeclared var


I also tried

(ns presentation.cognito.auth
  (:require ["amazon-cognito-identity-js$default" :as CognitoUserPool]))
but that didnt work either

Drew Verlee02:03:36

Can you share the js equivalent your working from? I always have to just pattern match from what I'm given to what's on that table.


likely is

(ns presentation.cognito.auth
  (:require ["amazon-cognito-identity-js$default" :refer (CognitoUserPool)]))


note not :as since CognitoUserPool is not the default export


note that the docs have a section on how to figure this out just below the examples


that should probably be more prominent but just at the end of that section


hmmm i changed it to your suggestion and get

:shadow.cljs.devtools.server.util/handle-ex - {:msg {:op :cljs-compile, :input {:code "(ns presentation.cognito.auth\n  (:require [\"amazon-cognito-identity-js$default\" :refer (CognitoUserPool) ]))", :ns presentation.cognito.auth, :repl true}, :include-init false, :call-id 7, :from 10}}
StackOverflowError (npm.clj:726)
when i try to evaluate the namespace


i’ll read those docs more and try an figure it out


I have this in a toy project (but, should work) (ns … (:require [“amazon-cognito-identity-js” :refer [AuthenticationDetails CognitoUserPool CognitoUserAttribute CognitoUser]] ))


@UF41YH1CM which shadow-cljs version do you use? the stackoverflow was a bug in 2.17.0 so upgrade if you use that


ahh yes i made the switch to 2.17.8 and it works perfectly now!