Fork me on GitHub
#shadow-cljs
<
2023-01-10
>
Stefan12:01:37

Hi all, the latest release of shadow-cljs seems trigger some issue in our code base. We have a test target that is an npm-module with compiler options :compiler-options {:external-config {:guardrails {}} :closure-defines {goog.DEBUG true}}}. We use the target to run jest tests. Starting the latest release of shadow-cljs, when we run jest we get this error:

● Test suite failed to run

    Unable to resolve spec: :expound.spec/specs

      at Object.cljs$spec$alpha$the_spec [as the_spec] (test-out/cljs/spec/alpha.cljs:121:18)
      at Function.cljs.spec.alpha.spec_impl [as cljs$core$IFn$_invoke$arity$5] (test-out/cljs/spec/alpha.cljs:518:28)
      at Function.cljs.spec.alpha.spec_impl [as cljs$core$IFn$_invoke$arity$4] (test-out/cljs/spec/alpha.cljs:513:28)
      at Object.<anonymous> (test-out/expound/alpha.cljc:119:1)
      at Object.<anonymous> (test-out/com.fulcrologic.guardrails.core.js:10:1)
I noticed that there were changes in the last shadow-cljs release to the npm-module target, but I have no idea if this is a regression or us doing something wrong, and I'm not sure where to start looking... Any hints on getting to the bottom of this maybe?

thheller12:01:03

hmm try :compiler-options {:cross-chunk-method-motion false} in the build config?

thheller12:01:18

which version did you use before?

Stefan12:01:56

Trying... (we're always on the latest, so it was 2.20.17 before)

thheller12:01:47

hmm but :target :npm-module was entirely broken for release builds for the last few versions?

Stefan12:01:28

We're only using that target for our unit tests, so not in release mode I think.

Stefan12:01:00

(We run shadow-cljs compile ... on that target)

Stefan12:01:48

That compiler option does not seem to fix the issue.

thheller12:01:11

hmm yeah I can reproduce the error. let me check whats going on

Stefan12:01:28

Great, thank you Thomas!

thheller12:01:36

should be fixed in 2.20.19

thheller12:01:05

note that I also did a closure-compiler version bump in that release. in case you have pinned older version

Stefan12:01:37

Wow, that's fast, thanks a lot; very grateful to you once again!

thheller13:01:11

weird that my test didn't catch this. was a pretty big issue what should have affected everything. guess I need to widen my test coverage 😉

Stefan13:01:16

I saw the delta of the commit that fixed it. I sometimes wonder how anyone can read clojure macros with all their quoting and unquoting. 🙂

thheller13:01:49

well especially if you hack macros from other namespaces 😛

😅 2