reitit

Scott Sutherland 2024-07-29T22:34:37.294809Z

I’m attempting to upgrade reitit from 0.6.0 to 0.7.1, and I’m running into the following error:

#error {
 :cause No such var: swagger/swagger-spec
 :via
 [{:type clojure.lang.Compiler$CompilerException
   :message Syntax error compiling at (reitit/coercion/malli.cljc:137:21).
   :data #:clojure.error{:phase :compile-syntax-check, :line 137, :column 21, :source reitit/coercion/malli.cljc}
   :at [clojure.lang.Compiler analyze Compiler.java 6825]}
  {:type java.lang.RuntimeException
   :message No such var: swagger/swagger-spec
   :at [clojure.lang.Util runtimeException Util.java 221]}]
This happens when the reitit.coercion.malli namespace is loaded. The project source where this happens is the following:
(reitit.coercion.malli/create
                           {;; set of keys to include in error messages
                            :error-keys       #{:coercion :in :schema :value :errors :humanized}
                            ;; schema identity function (default: close all map schemas)
                            :compile          mu/closed-schema
                            ;; strip-extra-keys (effects only predefined transformers)
                            :strip-extra-keys true
                            ;; add/set default values
                            :default-values   true})
This is fairly vanilla, and if I load reitit.coercion.malli by hand in the REPL, it loads… and the project code will evaluate… Has anyone run into a similar situation, I’m not having any luck finding the source of the problem.

2024-07-29T23:12:46.614729Z

Make sure your version of malli is at least 0.10.3.

👀 1
1
Scott Sutherland 2024-07-29T23:48:00.121519Z

Oh man, a transitive dependency was overriding the version included as a transitive dependency from reitit.malli:0.7.1… picard-facepalm