shadow-cljs

https://github.com/thheller/shadow-cljs | https://github.com/sponsors/thheller | https://www.patreon.com/thheller
theeternalpulse 2021-06-26T19:35:34.275500Z

Trying to follow the fulcro developer guide from scratch.  have all the basic deps and shadow config, startup script and html setup but when I run `npx shadow-cljs server` I get the following error

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.
I copied the configs so not sure what's missing. my deps.edn
{:paths   ["src/main" "resources"]
 :deps    {org.clojure/clojure    {:mvn/version "1.10.1"}
           com.fulcrologic/fulcro {:mvn/version "3.5.0-RC3"}
           #_[ com.fulcrologic/fulcro {:mvn/version "3.4.22"}]}

 :aliases {:dev {:extra-paths ["src/dev"]

                 :extra-deps  {org.clojure/clojurescript {:mvn/version "1.10.866"}
                               thheller/shadow-cljs      {:mvn/version "2.14.5"}
                               binaryage/devtools        {:mvn/version "1.0.3"}}}}}
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 mindjoin.client/init
                                       :entries [mindjoin.client]}}
                   :devtools   {:after-load mindjoin.client/refresh
                                :preloads   [com.fulcrologic.fulcro.inspect.preload]}}}}

theeternalpulse 2021-06-26T19:55:34.276Z

I saw an issue where this might come up because a version mismatch, but both this and in package.json are using shadow-cljs 2.14.5

theeternalpulse 2021-06-26T20:00:50.276900Z

the unspecified aliases looks suspicious, when I clear my .m2 repository and try to run the server again, i get tha alias error before it grabs the deps, and shadow is not a part of it. Is it not connecting the deps.edn with the shadow config?

theeternalpulse 2021-06-26T20:01:29.277400Z

[fulcroapp] npx shadow-cljs -v server                                                                                                    master  ✭
shadow-cljs - config: /home/deepe/projects/clojure/fulcroapp/shadow-cljs.edn
shadow-cljs - starting via "clojure"
WARNING: Specified aliases are undeclared: [:-A]
Downloading: org/clojure/clojure/1.10.1/clojure-1.10.1.pom from 
....(oteher deps)

thheller 2021-06-26T20:32:38.277900Z

@theeternalpulse can you try 2.14.4 of the npm package? the version in deps.edn can stay

theeternalpulse 2021-06-26T20:37:15.279300Z

just did that, still no dice. I was able to get it working by doing clj -A:dev to get it to put those jars in the classpath and then re-run it. Seems like something is not passing in the deps.edn alias : dev

thheller 2021-06-26T20:40:52.279900Z

@theeternalpulse I tried with the exact examples you pasted. just copied them into the files and it works fine

thheller 2021-06-26T20:41:30.280300Z

which clj -version do you use? maybe thats too old?

theeternalpulse 2021-06-26T20:42:59.280800Z

maybe, it doesn't have the -version option, I thought of upgrading that,

theeternalpulse 2021-06-26T20:43:10.281100Z

let me do that and try again

thheller 2021-06-26T20:47:01.281300Z

$ clj -version Clojure CLI version 1.10.3.855

theeternalpulse 2021-06-26T20:47:52.281800Z

I'm on ubuntu and this is what I get

[fulcroapp] clj -version                                                                                                              
Execution error (FileNotFoundException) at java.io.FileInputStream/open0 (FileInputStream.java:-2).
-version (No such file or directory)

thheller 2021-06-26T20:48:31.282100Z

clj --version?

thheller 2021-06-26T20:48:49.282400Z

clj -Sdescribe?

theeternalpulse 2021-06-26T20:48:52.282500Z

hmm, let me try removing completely

theeternalpulse 2021-06-26T20:49:04.283Z

seems there's a different one than I installed with apt

thheller 2021-06-26T20:49:14.283400Z

guess its some old version if it doesn't have -version

theeternalpulse 2021-06-26T20:49:14.283500Z

I think I may have installed it differently

theeternalpulse 2021-06-26T20:49:55.283900Z

using -Sdescribe gives me version "1.10.1.478" but that might just be from my deps?

thheller 2021-06-26T20:51:33.284300Z

no clue. I don't use deps.edn much. maybe try upgrading

theeternalpulse 2021-06-26T20:58:22.285Z

that did it, thanks for the second pair of eyes, I've been using plain old shadow-cljs for so long I didn't think that maybe clj tools were out of date

theeternalpulse 2021-06-26T20:58:51.285600Z

I was just following the tutorial, I find the integration of deps a bit confusing so I'll unwind that later