malli 2026-03-19

Hil all 🙂 I'm just trying to call (mp/provide [{:a :b} {:c :d}]) and I'm getting

Execution error (IllegalArgumentException) at malli.core/eval10593$fn$G (core.cljc:30)
No implementation of method: :-validator of protocol: #'malli.core/Schema found for class: nil
What am I doing wrong? 🤔

Maybe you need to have required malli.core as well? This works for me:

% clj
Clojure 1.12.4
user=> (require '[malli.core :as m] '[malli.provider :as mp])
nil
user=> (mp/provide [{:a :b} {:c :d}])
[:map [:a {:optional true} :keyword] [:c {:optional true} :keyword]]

hmm, malli.provider does depend on malli.core so that shouldn't be it

can you give me the full stack trace?

which malli version?

Yeah, I tried including malli.core, no difference.

malli-016.4

(mp/provide [{:a :b} {:c :d}])
Execution error (IllegalArgumentException) at malli.core/eval10593$fn$G (core.cljc:30).
No implementation of method: :-validator of protocol: #'malli.core/Schema found for class: nil
*e
=>
#error{:cause "No implementation of method: :-validator of protocol: #'malli.core/Schema found for class: nil",
       :via [{:type java.lang.IllegalArgumentException,
              :message "No implementation of method: :-validator of protocol: #'malli.core/Schema found for class: nil",
              :at [clojure.core$_cache_protocol_fn invokeStatic "core_deftype.clj" 585]}],
       :trace [[clojure.core$_cache_protocol_fn invokeStatic "core_deftype.clj" 585]
               [clojure.core$_cache_protocol_fn invoke "core_deftype.clj" 577]
               [malli.core$eval10593$fn__10605$G__10584__10610 invoke "core.cljc" 30]
               [malli.core$_proxy_schema$reify$reify__12530 _validator "core.cljc" 2016]
               [malli.core$eval10593$fn__10605$G__10585__10607 invoke "core.cljc" 30]
               [malli.core$eval10593$fn__10605$G__10584__10610 invoke "core.cljc" 30]
               [malli.core$_cached invokeStatic "core.cljc" 303]
               [malli.core$_cached invoke "core.cljc" 300]
               [malli.core$validator invokeStatic "core.cljc" 2320]
               [malli.core$validator invoke "core.cljc" 2314]
               [malli.core$validator invokeStatic "core.cljc" 2318]
               [malli.core$validator invoke "core.cljc" 2314]
               [clojure.core$juxt$fn__5912 invoke "core.clj" 2611]
               [clojure.core$mapv$fn__8569 invoke "core.clj" 7059]
               [clojure.core.protocols$fn__8279 invokeStatic "protocols.clj" 167]
               [clojure.core.protocols$fn__8279 invoke "protocols.clj" 123]
               [clojure.core.protocols$fn__8233$G__8228__8242 invoke "protocols.clj" 19]
               [clojure.core.protocols$seq_reduce invokeStatic "protocols.clj" 31]
               [clojure.core.protocols$fn__8266 invokeStatic "protocols.clj" 74]
               [clojure.core.protocols$fn__8266 invoke "protocols.clj" 74]
               [clojure.core.protocols$fn__8207$G__8202__8220 invoke "protocols.clj" 13]
               [clojure.core$reduce invokeStatic "core.clj" 6965]
               [clojure.core$mapv invokeStatic "core.clj" 7050]
               [clojure.core$mapv invoke "core.clj" 7050]
               [malli.provider$_inferrer invokeStatic "provider.cljc" 16]
               [malli.provider$_inferrer invoke "provider.cljc" 14]
               [malli.provider$provider invokeStatic "provider.cljc" 104]
               [malli.provider$provider invoke "provider.cljc" 96]
               [malli.provider$provide invokeStatic "provider.cljc" 111]
               [malli.provider$provide invoke "provider.cljc" 107]
               [malli.provider$provide invokeStatic "provider.cljc" 110]
               [malli.provider$provide invoke "provider.cljc" 107]
               [clojure.lang.Compiler eval "Compiler.java" 7757]
               [clojure.lang.Compiler eval "Compiler.java" 7712]
               [clojure.core$eval invokeStatic "core.clj" 3232]
               [clojure.core$eval invoke "core.clj" 3228]
               [nrepl.middleware.interruptible_eval$evaluate$fn__103925$fn__103926 invoke "interruptible_eval.clj" 87]
               [clojure.lang.AFn applyToHelper "AFn.java" 152]
               [clojure.lang.AFn applyTo "AFn.java" 144]
               [clojure.core$apply invokeStatic "core.clj" 667]
               [clojure.core$with_bindings_STAR_ invokeStatic "core.clj" 1990]
               [clojure.core$with_bindings_STAR_ doInvoke "core.clj" 1990]
               [clojure.lang.RestFn invoke "RestFn.java" 428]
               [nrepl.middleware.interruptible_eval$evaluate$fn__103925 invoke "interruptible_eval.clj" 87]
               [clojure.main$repl$read_eval_print__9248$fn__9251 invoke "main.clj" 437]
               [clojure.main$repl$read_eval_print__9248 invoke "main.clj" 437]
               [clojure.main$repl$fn__9257 invoke "main.clj" 459]
               [clojure.main$repl invokeStatic "main.clj" 459]
               [clojure.main$repl doInvoke "main.clj" 368]
               [clojure.lang.RestFn invoke "RestFn.java" 1526]
               [nrepl.middleware.interruptible_eval$evaluate invokeStatic "interruptible_eval.clj" 84]
               [nrepl.middleware.interruptible_eval$evaluate invoke "interruptible_eval.clj" 56]
               [nrepl.middleware.interruptible_eval$interruptible_eval$fn__103958$fn__103962
                invoke
                "interruptible_eval.clj"
                152]
               [clojure.lang.AFn run "AFn.java" 22]
               [nrepl.middleware.session$session_exec$main_loop__104028$fn__104032 invoke "session.clj" 218]
               [nrepl.middleware.session$session_exec$main_loop__104028 invoke "session.clj" 217]
               [clojure.lang.AFn run "AFn.java" 22]
               [java.lang.Thread run "Thread.java" 1583]]}

that's a pretty old version, have you tried a newer one? I'll try to reproduce on 0.16.4

I'll try 0.20.1

works for me on 0.16.4, same results as above

huh, odd, using 0.20.1 breaks the project in a different, completely unrelated way. There's a macro that creates a def which is unable to compile because there's a syntax error.

"First argument to def must be a Symbol"

Fine, but what does that have to do with the version of malli? 😅

Oh well, since it works for you on 0.16.4, I should be able to get that working, too.

But I can't. I tried using just a plain lein repl in the project to get less of the project complexity involved, and just require and call the above code... Same result

sounds like something's wrong in that project, for sure

try the same project.clj without any source directories, and then try to eliminate deps one by one?

Always a good option. This is a huge project, and I currently only need mp/provide for a one-off thing, so I think I'm going to try a blank project instead

Works in a blank project 🙂 With 0.20.1. Great.

Sorry to waste your time, I don't think I'm going to get to the bottom of the error this time around.

I was hoping it was a known thing where I was just doing something basic wrong.

Ended up with a very sastisfying PR automatically checking some data with malli 🙌

Print lein deps :tree and find your culprit?

have you done any code reloading when you hit this? I’ve seen this hit for me when i do things like (require <> :reload-all).

👀 1
☝️ 1

@ben.sless I don't know what to look for, though.

@dpsutton hm. Yes, but I think I also tried without reloading code. But let me check again