This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-03-25
Channels
- # aleph (9)
- # announcements (2)
- # babashka (32)
- # babashka-sci-dev (72)
- # beginners (77)
- # calva (1)
- # cider (3)
- # clj-kondo (19)
- # clojure (61)
- # clojure-brasil (13)
- # clojure-europe (25)
- # clojure-italy (1)
- # clojure-nl (2)
- # clojure-norway (27)
- # clojure-uk (23)
- # clojuredesign-podcast (6)
- # clojurescript (12)
- # conjure (2)
- # core-typed (3)
- # cursive (6)
- # datalevin (2)
- # datomic (13)
- # emacs (9)
- # events (19)
- # fulcro (6)
- # graphql (11)
- # gratitude (2)
- # helix (3)
- # honeysql (16)
- # jobs (1)
- # lsp (89)
- # malli (33)
- # meander (14)
- # off-topic (87)
- # pathom (4)
- # polylith (7)
- # portal (4)
- # practicalli (1)
- # rdf (6)
- # reagent (2)
- # releases (8)
- # remote-jobs (1)
- # shadow-cljs (59)
- # sql (8)
- # tools-deps (14)
- # xtdb (18)
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 (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/kh/tgss0d8s04v0xh2mtztlfw2r0000gn/T/clojure-15894664129410946386.edn
The full report:
{: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" 462]}],
:trace
[[clojure.lang.RT load "RT.java" 462]
[clojure.lang.RT load "RT.java" 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 "RestFn.java" 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 "RestFn.java" 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 "RestFn.java" 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 "RestFn.java" 137]
[clojure.lang.Var applyTo "Var.java" 705]
[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 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
com.fulcrologic.fulcro.inspect.dom-picker-preload
quizlet.development-preload]}}}}
this is a regular tools.deps install I assume? maybe thats outdated or broken somehow?
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
it should be this right https://clojure.org/guides/deps_and_cli
The weird thing is that it works in other projects. It's just this new one that's breaking
what I have seen before is some not-visible unicode char as the first char in deps.edn
Execution error (FileNotFoundException) at java.io.FileInputStream/open0 (FileInputStream.java:-2).
-version (No such file or directory)
Full report at:
/var/folders/kh/tgss0d8s04v0xh2mtztlfw2r0000gn/T/clojure-9249228989860048614.edn
hmm there is definitely something weird then? might just be super old? I get
$ clj -version
Clojure CLI version 1.10.3.855
clj -Sdescribe
{:version "1.10.1.561"
:config-files ["/usr/local/Cellar/clojure/1.10.1.561/deps.edn" "/Users/eoogbe/.clojure/deps.edn" "deps.edn" ]
:config-user "/Users/eoogbe/.clojure/deps.edn"
:config-project "deps.edn"
:install-dir "/usr/local/Cellar/clojure/1.10.1.561"
:config-dir "/Users/eoogbe/.clojure"
:cache-dir ".cpcache"
:force false
:repro false
:resolve-aliases ""
:classpath-aliases ""
:jvm-aliases ""
:main-aliases ""
:all-aliases ""}
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
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?
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 https://shadow-cljs.github.io/docs/UsersGuide.html#_using_npm_packages 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 varI also tried
(ns presentation.cognito.auth
(:require ["amazon-cognito-identity-js$default" :as CognitoUserPool]))
but that didnt work eitherCan 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.
and here is where all the exports are in the cognito lib https://github.com/aws-amplify/amplify-js/blob/main/packages/amazon-cognito-identity-js/src/index.js
likely is
(ns presentation.cognito.auth
(:require ["amazon-cognito-identity-js$default" :refer (CognitoUserPool)]))
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
shadow.build.npm/find-resource (npm.clj:726)
when i try to evaluate the namespaceI 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