Closed esciafardini closed 2 years ago
The only difference in deps when diff'ing the results of lein deps :tree
I see is the following:
I'm pressed for time just now, but you might look at Issue #231 where someone had problems with Figwheel, and I managed to replicate the problem and find a workaround for them. It too had to do with rewrite-clj/rewrite-cljs.
When I have a chance (soon, I hope), I'll see what I can figure out about your specific situation.
Hey, thanks for the response. I did see that issue - that's where I got the idea to play with dependencies, nothing I have has rewrite-clj as a dependency.
It's strange, when I bring in clj-fmt
as a dependency (which does require rewrite-clj) the build succeeds.
No rush, thank you
In order to try to reproduce this issue, it would help a lot to have your project.clj. I need to reproduce your dependencies in order to be able to get it to fail the way it does for you. Thanks!
Ah, okay, makes sense. I'm going to try digging a little more with lein with-profile dev deps :tree
- since the issue only happens in development mode....
Will update you asap.
Did you try the exclusion I added in Issue #231? I'm pretty sure that (at least the version I worked with then) Figwheel has rebelreadline
in it, and that has rewrite-clj(s) in it, which causes the problem. If you add the exclusion from #231 to your project.clj, you might be in luck.
:dev {:jvm-opts [...]
:source-paths ["src"]
:dependencies
[[org.clojars.runa/conjure "2.1.3"]
[figwheel-sidecar "0.5.20" :exclusions [org.clojure/tools.nrepl]]
[metosin/reitit-dev "0.5.15"]
[ring/ring-mock "0.4.0"]
#_[cljfmt "0.8.2" :exclusions [rewrite-clj]] ;;makes zprint work with figwheel (why?)
[cider/piggieback "0.4.2"]
[criterium "0.4.6"]
[hiccup-find "1.0.1"]]
:plugins
[[com.jakemccrary/lein-test-refresh "0.23.0"]
[lein-cooper "1.2.2"]
[lein-figwheel "0.5.20"]
[lein-pdo "0.1.1"]]}
Isolated the issue to be in my :dev profile.... I don't have rebel-readline in my :dev dependencies (where figwheel is used), but I've narrowed it down to being an issue solely within figwheel....
Thanks for pointing me toward rebel-readline as the issue!
:figwheel {:css-dirs ["resources/public/css"]
:nrepl-port 7888
:readline false
;; Load CIDER, refactor-nrepl and piggieback middleware
:nrepl-middleware ["cider.piggieback/wrap-cljs-repl"
"cider.nrepl/cider-middleware"]}
This fixed the issue for me! We are using [lein-figwheel "0.5.20"].
Thanks again!!
Setting :readline to false was the fix,
I'm having the same issue with the following deps.edn and haven't been able to pin down the cause yet. Will post here if I do.
{:paths ["src/main" "src/test" "resources"]
:deps {clj-http/clj-http {:mvn/version "3.12.3"}
cljs-ajax/cljs-ajax {:mvn/version "0.8.4"}
com.taoensso/timbre {:mvn/version "5.2.1"}
day8.re-frame/http-fx {:mvn/version "0.2.4"}
http-kit/http-kit {:mvn/version "2.5.3"}
metosin/reitit {:mvn/version "0.5.18"}
metosin/ring-http-response {:mvn/version "0.9.3"}
mount/mount {:mvn/version "0.1.16"}
org.clojure/clojure {:mvn/version "1.11.1"}
org.clojure/clojurescript {:mvn/version "1.11.54"}
org.clojure/data.json {:mvn/version "2.4.0"}
org.clojure/data.csv {:mvn/version "1.0.1"}
org.clojure/tools.logging {:mvn/version "1.2.4"}
re-frame/re-frame {:mvn/version "1.2.0"}
reagent/reagent {:mvn/version "1.1.1"}
zprint/zprint {:mvn/version "1.2.4"}
ring-cors/ring-cors {:mvn/version "0.1.13"}
ring-middleware-format/ring-middleware-format {:mvn/version "0.7.5"}
ring/ring {:mvn/version "1.9.5"}
ring/ring-defaults {:mvn/version "0.3.3"}
; See https://github.com/weavejester/hashp/pull/1
com.gfredericks/user.clj {:mvn/version "0.1.0"}
io.github.kovasap/perlin2d {:git/sha "bd6e8d60b83bdc2a8730dbd328c2899a90604773"}
thheller/shadow-cljs {:mvn/version "2.19.2"}}
:mvn/repos {"central" {:url "https://repo1.maven.org/maven2/"}
"clojars" {:url "https://repo.clojars.org/"}}
:aliases {:test {:extra-paths ["src/test"]
:extra-deps {lambdaisland/kaocha {:mvn/version "1.66.1034"}
lambdaisland/kaocha-cloverage {:mvn/version "1.0.75"}
day8.re-frame/test {:mvn/version "0.1.5"}}
:main-opts ["-m" "kaocha.runner"]}
:clj-kondo
{:extra-deps {clj-kondo/clj-kondo {:mvn/version "RELEASE"}}
:jvm-opts ["-Dghostwheel.enabled=true"]
:main-opts ["-m" "clj-kondo.main"]}
:frontend
{:main-opts ["-m" "shadow.cljs.devtools.cli"
"watch" ":app"]
:extra-deps {binaryage/devtools {:mvn/version "1.0.6"}}}
:repl/conjure
{:extra-deps {nrepl/nrepl {:mvn/version "0.9.0"}
cider/cider-nrepl {:mvn/version "0.28.4"}}
:main-opts ["-m" "nrepl.cmdline"
"--middleware" "[cider.nrepl/cider-middleware]"
"--interactive"]}
:api {:main-opts ["-m" "app.api"]}}}
Updating to cljfmt 0.9.2 in my global ~/.clojure directory solved my problem: https://github.com/kovasap/dotfiles/commit/e4475e4224f747b7cab4507f8dcdd61f8e1f3015
Updating to cljfmt 0.9.2 in my global ~/.clojure directory solved my problem: kovasap/dotfiles@e4475e4
Updating cljfmt worked for me as well, and the reason was this:
rebel-readline 0.1.4 brings in cljfmt 0.5.7 which brings inn both rewrite-clj 0.5.2 and rewrite-cljs 0.4.3.
rewrite-clj 1.x is a merge of rewrite-clj 0.x and rewrite-cljs 0.x, which means you should not have rewrite-cljs on classpath if you already have rewrite-clj 1.x. I had rewrite-clj 1.1.47 on classpath because of zprint 1.2.7 (because of re-frame-10x 1.9.3)
Upgrading cljfmt to 0.9.2 worked because it brings in rewrite-clj 1.1.45 instead of both rewrite-clj 0.x and rewrite-cljs 0.x. So rather than upgrading cljfmt I could also fix the problem by excluding rewrite-cljs from rebel-readline:
com.bhauman/rebel-readline {:mvn/version "0.1.4" :exclusions [rewrite-cljs/rewrite-cljs]}
With that said, maybe updating cljfmt is a better solution.
Adding zprint to a figwheel project & getting the following error message upon build:
It appears to be having issues finding
left*
which is not present in the newer version of rewrite-clj. I've checked my dependencies vialein tree :deps
and nothing is bringing in another version of rewrite-clj, so I'm not sure what's happening...Attempted solutions (in project.clj file):
This did not work...
For some reason this makes everything work (in project.clj file):
It was an accidental solution as I was experimenting with both zprint & cljfmt for a feature I'm working on. I want to use zprint - but when I removed the dependency for cljfmt, I started getting the error message.
Any insights would be greatly appreciated!!!