No protocol method IDeref.-deref defined for type om.core/MapCursor
I was following along David Nolen’s Om tutorial and found a curious error. When I got to the part where the delete buttons weren’t supposed to work, they worked just fine. Adding the derefing to contacts resulted in:
Uncaught Error: No protocol method IDeref.-deref defined for type om.core/MapCursor: [object Object]
I thought it might have to do with my Om version. Sure enough, latest was 0.3.0 and I was in 0.2.3. I went to project.cljs
and changed my dependencies to:
:dependencies [[org.clojure/clojure "1.5.1"]
[org.clojure/clojurescript "0.0-2138"]
[org.clojure/core.async "0.1.267.0-0d7780-alpha"]
[om "0.3.0"] ; was [om "0.2.3"]
[com.facebook/react "0.8.0.1"]]
But it didn’t work as expected. I asked David on twitter and he kindly pointed me to this Github issue, where I found the missing step:
$ lein cljsbuild clean
To regenerate the compiled js. With that done, everything worked as expected.