This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-02-25
Channels
- # aleph (1)
- # beginners (72)
- # boot (3)
- # cider (28)
- # cljs-dev (193)
- # cljsrn (11)
- # clojure (73)
- # clojure-brasil (3)
- # clojure-gamedev (2)
- # clojure-russia (6)
- # clojure-spec (30)
- # clojure-uk (26)
- # clojured (1)
- # clojurescript (32)
- # code-reviews (9)
- # core-async (4)
- # datascript (5)
- # datomic (9)
- # dirac (38)
- # fulcro (23)
- # garden (11)
- # leiningen (1)
- # luminus (11)
- # lumo (6)
- # off-topic (17)
- # quil (2)
- # re-frame (2)
- # reagent (3)
- # ring (3)
- # shadow-cljs (12)
- # spacemacs (4)
- # sql (2)
- # unrepl (85)
- # vim (3)
Hey guys I’ve been working my way through the fulcro book but having issues running some of the examples in the REPL. I’m pretty new to Clojure(script) so not really sure about REPL but this is the kinda error I’m getting
STARTING FIGWHEEL ON BUILDS: (dev)
Figwheel: Starting server at
Figwheel: Watching build - dev
Compiling "resources/public/js/okeydoke.js" from ["src/dev" "src/main"]...
Failed to compile "resources/public/js/okeydoke.js" in 45.026 seconds.
---- Could not Analyze src/main/okeydoke/api/mutations.cljs ----
No such namespace: app.ui.root, could not locate app/ui/root.cljs, app/ui/root.cljc, or JavaScript source providing "app.ui.root"
---- Analysis Error : Please see src/main/okeydoke/api/mutations.cljs ----
Figwheel: Starting CSS Watcher for paths ["resources/public/css"]
Launching ClojureScript REPL for build: dev
Figwheel Controls:
(stop-autobuild) ;; stops Figwheel autobuilder
(start-autobuild [id ...]) ;; starts autobuilder focused on optional ids
(switch-to-build id ...) ;; switches autobuilder to different build
(reset-autobuild) ;; stops, cleans, and starts autobuilder
(reload-config) ;; reloads build config and resets autobuild
(build-once [id ...]) ;; builds source one time
(clean-builds [id ..]) ;; deletes compiled cljs target files
(print-config [id ...]) ;; prints out build configurations
(fig-status) ;; displays current state of system
(figwheel.client/set-autoload false) ;; will turn autoloading off
(figwheel.client/set-repl-pprint false) ;; will turn pretty printing off
Switch REPL build focus:
:cljs/quit ;; allows you to switch REPL to another build
Docs: (doc function-name-here)
Exit: Control+C or :cljs/quit
Results: Stored in vars *1, *2, *3, *e holds last exception object
Prompt will show when Figwheel connects to your application
To quit, type: :cljs/quit
dev:cljs.user=> (go)
---- Compiler Warning on cljs form line:1 column:2 ----
Use of undeclared Var cljs.user/go
1 (go)
^---
---- Compiler Warning ----
#object[TypeError TypeError: Cannot read property 'call' of undefined]
nil
dev:cljs.user=>
Any ideas what I’m doing wrong?Do you have a directory src/main/app/ui
off the project root, that has a file in it called root.cljs
, or root.clc
? At the top of that file is the ns app.ui.root
?
nah its actually src/main/okeydoke/ui
and at the top of the file is ns okeydoke.ui.root
. I think I created it using the lein command
So try and rename everything that says okeydoke
to app
. That should get rid of the errors.
thanks for the help, I deleted my folder and started a new project with lein new fulcro my-project
but still not having any luck. I’ll keep working though the book and see if theres something I’m missing
@U2RGGEK17 did you check out the video series ?
Ahh nah I haven't yet. I watched one of the older videos Tony did when it was untangled but haven't watched newer ones. At the moment I think it's probably a bit much trying to jump in and learn fulcro without very much clojure experience. Setting up environments and and understand REPLs and stuff is a bit confusing
Just released version 2.2.1, which includes some improvements to UI routing, and the dev guide section about it http://book.fulcrologic.com/#BasicRouter
The improvements are backward compatible (the new support allows you to use fn
instead of ident
for the ident part of the defrouter, but that is just to improve IDE recognition. Technically it doesn’t care what symbol you use there now).
@tony.kay Still playing around with dx-react-grid. I’d like to be able to query the server for a list of items - and then target a node in the graph w/o any normalization. Not quite how to accomplish that, as it’s not the normal fulcro model. This is read-only data that I want to plop into a grid control. I could do a post-mutation but then I have data in the graph that’s likely not used. I could do the query / modify the state-map out-of-band. Thoughts?
@donmullen not a problem..just don’t add a component/query/ident for that edge 🙂
So, if you (load :root/list-of-things nil)
and the server returns a vector of maps, then you’ll have that vector of maps at that root key
@tony.kay - ah - thanks. I was using a component so that I’d have a query - but in this case I would pass nil or component, and perhaps pass the query in params.
@tony.kay - ok thanks. So this worked (used a component with no ident):
(df/load app :pluto-properties PropertyItems {:target [:root-properties]})
but this new target:
(df/load app :pluto-properties PropertyItems {:target [:root-grid :grid-demo/grid :grid/rows]})
got error:
Mutation fulcro/load failed with exception Error: Vector's key for assoc must be a number.