Fork me on GitHub
#fulcro
<
2018-12-26
>
juri01:12:51

I'm seeing some strange behavior and I can't figure out how to fix it. In my Root component I have a Person and a Week:

juri01:12:39

But, for some reason two Persons are rendered:

juri01:12:08

Person has blue background

juri01:12:44

And I get the following error message in Chrome dev tools console:

juri02:12:32

If I comment out the (ui-person current-user), reload client so that no Person is showing, and then uncomment, only one Person is rendered, and I don't get any error message.

juri02:12:57

If I comment out (ui-week selected-week) and reload client, the Person renders as expected, and I don't get any error message

juri02:12:45

Both the Person/current-user and Week/selected-week are loaded in :started-callback

juri02:12:27

And neither of them references the other or use any children of the same type

juri02:12:13

Furthermore the client database looks as I expect it to.

sooheon04:12:14

@wilkerlucio I noticed in your talk you used Cursive--have you ever encountered java.lang.IndexOutOfBoundsException: Method code too large! when trying to debug in a project with pathom?

wilkerlucio10:12:00

yes I had that before, I had to break some functions after some time, I guess the go macro is getting very large expansion and then it goes over the method size

sooheon11:12:05

Yeah think it’s too big currently

sooheon04:12:37

Specifically here: Caused by: Syntax error compiling fn* at (com/wsscode/pathom/connect.cljc:853:38)

sooheon04:12:32

@juri could you show more of the code?

juri05:12:13

@sooheon Yes, gladly. Here's a link to a folder in the repo. As far as I know only the client.cljs in the same folder and ui/root.cljs are relevant here: https://github.com/juripyykko/fulcro-tidsrapport/tree/master/src/main/fulcro_tidsrapport

currentoor16:12:56

the error you’re seeing is purely a react error, not related to the parts fulcro does, i.e. it’s UI rendering only

currentoor16:12:29

you have :keyfn set on a number of your components, one of them is probably getting props that have their corresponding :db/id missing at some point in the render cycle

currentoor16:12:03

perhaps before the initial load

currentoor16:12:32

oh lol the fulcro log message right below says it all

currentoor16:12:16

the Week component is not getting a value for :week/number

eric.shao18:12:22

Ask for help~ I’m trying Fulcro+ReactNative . Meet the problem

[fulcro.client.network] Transit decode failed! SyntaxError: JSON Parse error:Unexpected identifier "unexpected"
In the SERVER side: Using lein new fulcro … user> (start) My mac’s lan address is 192.168.10.192 I turn off the :security {:anti-forgery false} And I am not behind a proxy. When I directly visit http://192.168.10.192:3000/api in browser , got a 403 Forbidden .But I added there addresses in defaults.edn
;; Legal Origins for API request.
 :legal-origins #{"localhost" ""  "192.168.10.192:3000" "192.168.10.192" "" "192.168.10.192:3000/api"}
In my RN-CLIENT side: I am using [fulcrologic/fulcro “2.5.0”] only this version works. Code is:
; [fulcro.client.network :as net]
(defonce app
         (atom
           (fulcro/new-fulcro-client
             :started-callback (fn [app]
                                 (do
                                   (js/console.log "in started-callback")
                                   (df/load app :current-user com.wsscode.multi-timer.components.person/Person)))
             :reconciler-options {:root-render  support/root-render
                                  :root-unmount support/root-unmount}
             :networking {:remote (net/fulcro-http-remote
                                    {:url                ""
                                     :request-middleware net/wrap-fulcro-request})}
             )))

tony.kay23:12:59

@eric.shao A GET is never handled by Fulcro API (which is what a browser load of the URI will try)

tony.kay23:12:24

you have to actually test a mutation or load

tony.kay23:12:36

(or manually encode one into transit+edn in a POST tool)

tony.kay23:12:02

Also, there is a bug in legal origins, I think…unconfirmed

tony.kay23:12:35

it’s not much code, so since you’re already there, copy it from Fulcro into your code and see if you can fix it. If you do, please send a PR. I don’t have time to deal with it.