Fork me on GitHub
#fulcro
<
2018-12-23
>
juri03:12:12

In http://book.fulcrologic.com/#_step_1_the_initial_state it says that I can pull stuff from the REPL: dev:cljs.user=> (fulcro.client.primitives/get-initial-state fulcro-tidsrapport.ui.root/Root {}). However, I'm not sure how to access this. I have one REPL in the browser via shadow-cljs, where i started the server. But it doesn't work there. I get "CompilerException java.lang.RuntimeException: No such var: fulcro-tidsrapport.ui.root/Root". I also connected to the one I saw in the terminal "shadow-cljs - nREPL server started on port 9000", but it didn't work there either. Is there a REPL running on the client localhost:3000 that I can (should?) connect to somehow?

pauld04:12:48

Are you using cursive or emacs?

pauld04:12:15

Earlier in section 2.2 you were supposed to (start) a server. That will listen on localhost:3000. Did you do that?

pauld04:12:56

Also make sure your read the README in your project template.

pauld04:12:13

Were you able to successfully connect to localhost:9630 after starting the shadow-cljs as described in 2.2.1? The builds menu should show if main is compiling and being watched. If not, select it. Once you're able to start the server and load the page on port 3000, you should be able to connect to the browser repl.

pauld04:12:46

you might have to do lein repl to get a clojure repl and something else for a clojurescript repl

pauld04:12:36

I'm using emacs cider so I create both repls via cider-jack-in-clj&cljs other people here should be able to help you with cursive.

pauld04:12:01

Also, looking at your error it may be that you are not in fulcro-tidsrapport.ui.root namespace. You could do (in-ns fulcro-tidsrapport.ui.root) first then it should find the Root. Or you could (require '[fulcro-tidsrapport.ui.root as root]) then you can run (fulcro.client.primitives/get-initial-state root/Root {})

juri06:12:45

I am using Cursive. Yes i did the (start), was able to connect to localhost:9630, and have compiled the main build. And I can also see the website on localhost:3000.

juri06:12:41

Do I connect to the browser REPL on localhost:3000? When I try, it just waits, unlike when I connect to 9000, which was started together with shadow-cljs

juri06:12:59

I also tried the (in-ns ...)

juri06:12:07

Oh, I got it working now. Didn't know there were two REPLs in shadow-cljs. The second one appears after I connect to localhost:3000, but I already had the other REPL open earlier, so I missed that

juri06:12:18

sorry 🙂 and thanks again

pauld13:12:58

you're welcome - good luck!