Fork me on GitHub

are there any known issues with specter and CLJS? Getting the following when running cljs.analyzer on the specter code:

com/rpl/specter.cljc - root cause: clojure.lang.ExceptionInfo Unable to resolve var: coll? in this context at line 1449 specter/com/rpl/specter.cljc


@martinklepsch there's currently this issue but I think it's unrelated


@martinklepsch Is cljdoc on using cljs later than 1.10.238? That is the version I am using and that code works just fine. I just checked and the current release is 1.10.439(!!) The one I'm using is only a few months old. Seems to be changing at a crazy rate. Let me see what happens if I try the newest version.


@nathanmarz @martinklepsch OK, somewhere along the line in those 201 new releases something has changed and causes regressions. Using the latest cljs the code compiles ok (no errors / warning and signals successful completion) but fails immediately when trying to run it with this:


#object[RangeError RangeError: Maximum call stack size exceeded]
   cljs.core/build-subvec (jar:file:/home/jsa/.m2/repository/org/clojure/clojurescript/1.10.439/clojurescript-1.10.439.jar!/cljs/core.cljs:5908:25)
   cljs$core$IWithMeta$_with_meta$arity$2 (jar:file:/home/jsa/.m2/repository/org/clojure/clojurescript/1.10.439/clojurescript-1.10.439.jar!/cljs/core.cljs:5793:28)
   cljs.core/-with-meta (jar:file:/home/jsa/.m2/repository/org/clojure/clojurescript/1.10.439/clojurescript-1.10.439.jar!/cljs/core.cljs:686:21)
   cljs.core/with-meta (jar:file:/home/jsa/.m2/repository/org/clojure/clojurescript/1.10.439/clojurescript-1.10.439.jar!/cljs/core.cljs:2059:8)
   cljs.core/vec (jar:file:/home/jsa/.m2/repository/org/clojure/clojurescript/1.10.439/clojurescript-1.10.439.jar!/cljs/core.cljs:5662:6)
   com$rpl$specter$impl$CoercePath$coerce_path$arity$1 (jar:file:/home/jsa/.m2/repository/com/rpl/specter/1.1.1/specter-1.1.1.jar!/com/rpl/specter/impl.cljc:180:27)
   com.rpl.specter.impl/coerce-path (jar:file:/home/jsa/.m2/repository/com/rpl/specter/1.1.1/specter-1.1.1.jar!/com/rpl/specter/impl.cljc:155:17)
   com$rpl$specter$impl$CoercePath$coerce_path$arity$1 (jar:file:/home/jsa/.m2/repository/com/rpl/specter/1.1.1/specter-1.1.1.jar!/com/rpl/specter/impl.cljc:180:14)
   com$rpl$specter$impl$coerce_path (jar:file:/home/jsa/.m2/repository/com/rpl/specter/1.1.1/specter-1.1.1.jar!/com/rpl/specter/impl.cljc:155:17)


I think I will try a mini binary search to try to pin point in which release cljs was broken (or less likely, 'fixed' something that was broken but causes regressions)


OK, didn't take long. Despite a couple hundred point increments, the releases go from 1.10.439 to 1.10.339 as a first jump. 1.10.339 works fine. So, 1.10.439 is what is broken. It has a very large number of differences across 'changes', 'enhancements', and 'fixes'. So, it is not too surprising it went off the rails...


Just to finish, the actual releases go 1.10.238 -> 1.10.312 (a lot of 'fixes') -> 1.10.329 (a few 'fixes') -> 1.10.339 (just a transit-clj version bump) -> 1.10.439


Likely 'goats'/culprits: CLJS-2805: Bump tools.reader to 1.3.0, Align ClojureScript AST to tools.analyzer, CLJS-2442: set and vec performance enhancements. Those last two definitely smell bad given where the problems here are manifesting...


@jsa-aerial that's very interesting, thanks for digging in


I previously had another problem with the analyzer (turned out it was my fault) but I think if you could create a minimal repro how the analyzer fails with specter that would be very interesting to #cljs-dev


☝️ you can take a look at this for how this could look


the analyze-file call would need to be pointed at com/rpl/specter.cljc and you'd need to add specter to the :deps map.


btw, I also get the coll? issue in 1.10.339


@martinklepsch just to be clear - I do not get any analyzer problem in my code with any of those releases. So, I can't make that repo. So, if it is still happening with 1.10.339 I would suggest going back further to try to isolate that. For me, the error happens at runtime and since it occurs in vec, I would guess those 'enhancements' to set and vec for performance are the problem.


@martinklepsch one other thing of note: I have another repo (Saite) which uses Hanami (the one causing cljdoc bogus analyzer error) which sails through cljdoc just fine. So, maybe there is something wrong in the way cljdoc sets up the analyzer for this?


To be clear: Both of those use the specter lib in question, and both use it in exactly the same way.


Interesting, can you provide dependency coordinates for both of these projects so I can compare? 🙂


Not sure what 'dependency coordinates' means. Maybe the repo URLs?