Search code examples
clojureclojurescriptom

Clojure om next multiple print-method exception


I am trying to build server-side rendering for om.next (1.0.0-alpha47). At some point I have to create a reconciler from Clojure:

 (om/reconciler {})

 (om/reconciler
  {:state     (atom {})
   :normalize true
   :parser    (om/parser {})})

However evaluating any of these in my REPL gives:

Unhandled java.lang.IllegalArgumentException Multiple methods in multimethod 'print-method' match dispatch value: class
om.next.Reconciler -> interface clojure.lang.IDeref and interface
clojure.lang.IRecord, and neither is preferred

How do I fix that?


Solution

  • I came to this solution via trial and error:

    (prefer-method print-method clojure.lang.IPersistentMap clojure.lang.IDeref)
    

    This seems to solve the conflict, sorry that I can't explain any details.