This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-04-29
Channels
- # announcements (35)
- # aws (40)
- # babashka (10)
- # beginners (119)
- # calva (25)
- # cider (13)
- # clj-kondo (15)
- # cljsrn (23)
- # clojure (205)
- # clojure-dev (3)
- # clojure-europe (15)
- # clojure-germany (3)
- # clojure-italy (3)
- # clojure-nl (2)
- # clojure-uk (58)
- # clojurescript (193)
- # community-development (2)
- # conjure (147)
- # core-async (49)
- # cursive (47)
- # datomic (27)
- # duct (1)
- # fulcro (19)
- # graalvm (3)
- # graphql (1)
- # helix (3)
- # hoplon (11)
- # jackdaw (1)
- # joker (1)
- # juxt (5)
- # kaocha (1)
- # keechma (3)
- # lambdaisland (6)
- # local-first-clojure (27)
- # malli (5)
- # off-topic (41)
- # rdf (27)
- # re-frame (7)
- # reagent (15)
- # reitit (5)
- # rum (11)
- # shadow-cljs (157)
- # spacemacs (18)
- # sql (4)
- # xtdb (8)
To test my app's routes, I'm using the reitit frontend, push-state function like so:
(rfe/push-state :home)
And my routes are:
(def router
(reitit/router
[["/" {:name :home
:view #'home
:controllers [{:start (fn [_] (rf/dispatch [:page/init-home]))}]}]
]))
But I get the error:
No protocol method Router.match-by-name defined for type null:
Why is that and what am I doing wrong?@pshar10 you probably need to call rfe/start!
so that rfe's router atom gets set
Does anyone know the best way to debug routes? I.e. I get http 500 but would like to acess a stack trace or someting
Check out the second argument to reitit.ring/router
. We have the following options at the top of the map:
:exception pretty/exception
;; uncomment the next line (and the matching require in `ns`) to get some really pretty diffs around each middleware call
;;:reitit.middleware/transform reitit-dev/print-request-diffs
That will print out some extensive debugging information for each request that comes thru (like, a LOT of info--which is why we keep it commented out when we’re not debugging routes 😄 )