swannodette / mies-om

Less is More template for Om

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error when going through the basic tutorial. No target specified to om.core/root

xicubed opened this issue · comments

I'm going through the basic example on https://github.com/swannodette/om/wiki/Basic-Tutorial and When I look at the index.html after creating/compiling the om-tut I get an error:

Uncaught Error: Assert failed: No target specified to om.core/root

Nothing displays in the browser.

I had to change the original om-tut/src/om_tut/core.cljs you get from the mies-om template (via lein new mies-om om-tut)

from

(om/root
  app-state
  (fn [app owner]
    (dom/h1 nil (:text app)))
  (. js/document (getElementById "app")))

to

(om/root
  (fn [app owner] 
    (dom/h1 nil (:text app)))
  app-state
  {:target (. js/document (getElementById "app"))})

seems like it was missing the {:target... part?

Fixed in master an deployed to Clojars