Fork me on GitHub

That error means that the route ended up with an ident not listed in your defrouter


@oliver.mooney your ident functions and route instructions need to be consistent…you’ve used :profile for the table name in the routing table, :PAGE/profile in the router, and the the Profile page itself uses the destructured page (which is :PAGE/profile). So, the error is in your routing tree instruction.


I should probably change defrouter to generate a “default” route that shows this error better 🙂


Try 2.5.4-SNAPSHOT and see if the error is better…same me some testing time 🙂


how to add form config to a root ident? I tried all of the following, none worked:

(fs/add-form-config* MyFormComp [:my-root-key])
(fs/add-form-config* MyFormComp [:my-root-key '_])
(fs/add-form-config* MyFormComp :my-root-key)


@tony.kay that error-mode is much better thanks! I see "Cannot route: Unknown Screen" in my UI and no console error message, it's a much better hint


@myguidingstar I think {:my-root-key '_}


since its a join (maybe in a vector)


@thheller I literally meant '_ as it's the syntax for querying "links". You may have thought I use '_ as a placeholder for some properties, but it's not the case


hmm you are right. I confused the syntax for join again. 🙂


after looking at the app state I guess the first one works. But I need to clean up the mess to confirm 😄


the book says a form component must have :ident, so my effort to use a root ident won't work


I'm trying to use root idents. Why does this print an empty map?

(defsc Root [this props]
  {:initial-state (fn [params] {:user/whoami {:user/name "Guest"}})
   :query [{[:user/whoami '_] [:user/name]}]}
  (dom/div {}
    (dom/div (str "user: " (pr-str props)))))


I expected it to print out "Guest"


@myguidingstar In general Root is a special node. It cannot have an ident, and link queries (which mean “jump back to root”) aren’t meant to be used there. The latter is technically a bug, but the workaround is so trivial that I have not bothered to fix it (when already in root change [:x '_] to :x).


It’s an artifact of the overall design that the Root shares the same space as all of the tables, and in general I recommend that you just create a root that “gets you to the app root” as quickly as possible 🙂


@oliver.mooney Thanks for checking

Daniel Hines00:05:11

Hi Thắng. I wanted to let you know I haven’t forgotten about the real-world app. How is it going? The pressure’s increased on my project at work so I haven’t had much free time, but I should see a light at the end of the tunnel soon.


I am using (dom/span #js {:style {:color "blue"}} (str "11111" name)) to color the text, but it is staying black. What is it that I am doing wrong?


Needs another #js after :style I would say.


But there are ways to completely avoid using #js in the book.


@rudiwillalwaysloveyou if you just bump to 2.5+ you don't need the #js at all


@wilkerlucio @cjmurphy I am doing the tutorial which is on an alpha version of 2.5 … Strangely enough adding the second #js solved the issue, and then removing them both worked fine as well (which I had tried first before adding the single #js). I have no idea why.


yeah, probably because of the conversion rules


if you used js on the first, it will not convert anything after that


but by sending a clojure map the macro will convert it at compile time to js recursively

👍 4

@rudiwillalwaysloveyou The macro only does automatic conversion if you pass it a normal data struture. If it is already a js value, it assumes you know what you’re doing and works in bw compat mode


so, if you use #js you have to convert it all by hand. If you don’t, you don’t.


so, yeah, what Wilker said 🙂