reitit

d._.b 2024-08-15T22:00:37.470159Z

I am upgrading from 0.6.0 to 0.7.1, and my app is throwing this:

:cause ":malli.core/invalid-schema\n\n{:schema nil, :form nil}",
  :data
  {:type :malli.core/invalid-schema,
   :message :malli.core/invalid-schema,
   :data {:schema nil, :form nil},
   :reitit.exception/cause #error {
 :cause ":malli.core/invalid-schema"
 :data {:type :malli.core/invalid-schema, :message :malli.core/invalid-schema, :data {:schema nil, :form nil}}
 :via
 [{:type clojure.lang.ExceptionInfo
   :message ":malli.core/invalid-schema"
   :data {:type :malli.core/invalid-schema, :message :malli.core/invalid-schema, :data {:schema nil, :form nil}}
   :at [malli.core$_exception invokeStatic "core.cljc" 148]}]
I think it has to do with a change to coercion, but im not seeing it

d._.b 2024-08-16T20:16:20.810699Z

pretty cool, thank you

2024-08-15T22:24:07.559769Z

Is your malli version the latest?

d._.b 2024-08-15T22:56:55.761849Z

It is [metosin/malli "0.16.2"], no explicit dependency on malli, getting this version through reitit.

d._.b 2024-08-15T22:58:19.808559Z

looking at malli, looks like the answer would be "no, 0.0.1 behind latest"

2024-08-15T23:24:34.211759Z

I think that's good enough.

2024-08-15T23:25:10.404819Z

Could you post the full trace?

2024-08-15T23:44:07.528129Z

Another idea: pull in https://github.com/clojure/tools.trace?tab=readme-ov-file#releases-and-dependency-information, evaluate this, run your program, and post the end of the trace.

(require '[clojure.tools.trace :as t]
           '[malli.core])
  (t/trace-vars malli.core/schema)
  (alter-var-root #'t/trace-fn-call
                  (fn [_]
                    (fn [name f args]
                      (let  [id  (gensym  "t")]
                        (#'t/tracer id  (str  (#'t/trace-indent)  (pr-str  (cons name (take 1 args)))))
                        (let  [value  (with-bindings  {#'t/*trace-depth*  (inc @#'t/*trace-depth*)}
                                        (apply f args))]
                          (#'t/tracer id  (str  (#'t/trace-indent)  "=> "  (pr-str value)))
                          value)))))
Should look like this:
TRACE t6816: (malli.core/schema [:map [:a [:tuple [:map [:b :int]]]]])
TRACE t6817: | (malli.core/schema [:map [:a [:tuple [:map [:b :int]]]]])
TRACE t6818: | | (malli.core/schema [:tuple [:map [:b :int]]])
TRACE t6819: | | | (malli.core/schema [:map [:b :int]])
TRACE t6820: | | | | (malli.core/schema :int)
TRACE t6820: | | | | => :int
TRACE t6819: | | | => [:map [:b :int]]
TRACE t6818: | | => [:tuple [:map [:b :int]]]
TRACE t6817: | => [:map [:a [:tuple [:map [:b :int]]]]]
TRACE t6816: => [:map [:a [:tuple [:map [:b :int]]]]]

🤩 1