Given the following namespaces:
And build configuration
Building this code and opening it in a browser will show the following runtime error:
Adding source maps to the build will show the error occurs in the reify call inside cljs.spec.alpha/regex-spec-impl.
produced this minimal reproduction after I found the problem happening in our application when attempting to update to CLJS 1.10.597.
He looked further into the causes and describes it succinctly as:
Cause by cross-chunk method motion partially moving a reify "class" instance and trying to add methods to a class that hasn't been defined yet. Presumably because the Closure Compiler doesn't expect classes to be defined conditionally.
He also mentioned the cause for it lies not with cljs.spec but with reify itself, and that https://ask.clojure.org/index.php/8879/cljs-should-macros-support-lifting-vars-to-the-ns-level might prevent this behaviour.
Code for this reproduction can be found in https://github.com/thheller/cljs-method-motion-bug.