Hi everyone, beginner to cljs here.
I just worked through the Intermediate Tutorial for Om at
https://github.com/swannodette/om/wiki/Intermediate-Tutorial by following the
explanations and typing along.
The tutorial ends with editable input fields rendered by React and persisted in
Datomic. At this point I encountered this error in the console (bug is in my
code; keep reading):
Uncaught Error: No protocol method ITransact.-transact! defined for type
cljs.core/PersistentHashMap: {:class/id "6946", :db/id 17592186045423,
:class/students #{{:db/id 17592186045428} {:db/id 17592186045430} {:db/id
17592186045431} {:db/id 175921...<omitted>...}} core.cljs:136
So firstly the line doesn't match up. But I fiddle around with the "data"
variable getting passed around in the "handle-change" function in core.cljs to
no avail. I can cause another interface error which I'm not familiar with, and
the line number doesn't change.
Then I redid the entire tutorial and copy+pasted whenever possible, and
realized that what causes this error is a missing "vec" argument in my
(server-side!) core.clj:
(defn get-classes [db]
(->> (d/q '[:find ?class
:where
[?class :class/id]]
db)
(map #(d/touch (d/entity db (first %))))
;; BUG: when absent, leads to cljs error!
;; vec
))
Totally didn't see that coming! My question is this. When you encounter an
error like the one above, what clues tell you to look in the server-side clj
rather than the client-side cljs?
Thanks!
--
Note that posts from new members are moderated - please be patient with your
first post.
---
You received this message because you are subscribed to the Google Groups
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/clojurescript.