This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-04-13
Channels
- # aleph (1)
- # beginners (105)
- # boot (6)
- # cider (9)
- # cljs-dev (61)
- # cljsrn (59)
- # clojure (132)
- # clojure-germany (1)
- # clojure-italy (6)
- # clojure-russia (18)
- # clojure-spec (1)
- # clojure-uk (58)
- # clojurescript (56)
- # core-async (1)
- # cursive (17)
- # datomic (20)
- # docs (1)
- # duct (5)
- # editors (1)
- # emacs (7)
- # events (2)
- # figwheel (7)
- # fulcro (30)
- # graphql (8)
- # jobs (3)
- # leiningen (23)
- # luminus (14)
- # mount (6)
- # off-topic (41)
- # onyx (14)
- # protorepl (2)
- # re-frame (7)
- # reagent (32)
- # shadow-cljs (236)
- # tools-deps (92)
- # unrepl (8)
- # vim (60)
- # yada (1)
I'm getting this error the first time the fulcro easy server starts up:
ERROR [fulcro.server:303] : java.lang.IllegalArgumentException: No method in multimethod 'read-root' for dispatch value: :surveys Parser error:
{:status 500, :body {:type "class java.lang.IllegalArgumentException", :message "No method in multimethod 'read-root' for dispatch value: :surveys"}
When I run (restart)
at the repl, it fixes it, so I assumed it was some sort of race condition. But it happens in a production build as well, which just crashes the app. Any ideas?Fixed it. The problem was the obvious one: I wasn't requiring the file that had defquery-root
. @tony.kay, I was just following along with fulcro-todomvc though - it doesn't look like fulcro-todomvc.api
is ever required anywhere. Is that intentional or a bug?
doesn't matter where it gets required, just as long as something requires it that is also required (transitively) from the entry point
All mutations and queries are just multimethods behind the scenes (which are just maps from dispatch keys to functions)..the def
calls just add entries to the map (which is what the defmulti creates)
@tony.kay I was asking myself that same question! My eyes just missed that line. Thanks!
realize that defsc is error-checked, so it may complain if you have certain things wrong that were non-harmful at runtime
@troglotit Why have you quoted the forms in each branch? And nested them inside a list? Unevaluated components won't be valid children (as the error complains) and AFAIK they should be nested in a container component like a span or div if you're trying to render multiple components (the latest React version changes this but I haven't used it in fulcro)
but in React you always could <div>{true?<div/><div/>:""}</div>
- that’s what I’m trying to do
@troglotit nope…the quoting is just wrong. If you want a list of them, use a vector (unquoted)
and since you’re using low-level js components, you will probably need to put #js
in front of that.
I have defui’s that had signatures as follows, but that doesn’t seem to work with defsc:
(defsc RadioGroupControl
f/IReactKey
(react-key [T {:keys [key]}]
(or key (f/unique-react-key)))
IFormControl etc...
(defsc RadioGroupControl [this props]
{:query [:prop]
:ident [:table :prop-of-id]
:protocols [f/IReactKey
(react-key ...)]
(dom/div ...))
You only need protocols for non-Fulcro protocols…the rest have options in the options map