This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-10-19
Channels
- # adventofcode (1)
- # announcements (3)
- # babashka (60)
- # beginners (60)
- # calva (5)
- # clj-commons (17)
- # clj-kondo (33)
- # clj-on-windows (1)
- # clojure (40)
- # clojure-austin (3)
- # clojure-europe (19)
- # clojure-gamedev (25)
- # clojure-nl (1)
- # clojure-norway (6)
- # clojure-sweden (4)
- # clojure-uk (2)
- # clojurescript (27)
- # conjure (1)
- # core-async (1)
- # core-typed (7)
- # cursive (5)
- # datomic (35)
- # events (1)
- # fulcro (35)
- # integrant (7)
- # introduce-yourself (2)
- # kaocha (5)
- # leiningen (2)
- # lsp (26)
- # malli (13)
- # nbb (99)
- # off-topic (15)
- # pathom (12)
- # pedestal (5)
- # polylith (8)
- # portal (4)
- # rdf (19)
- # reagent (8)
- # reitit (5)
- # releases (2)
- # remote-jobs (2)
- # rewrite-clj (1)
- # shadow-cljs (94)
- # testing (2)
- # timbre (2)
- # tools-deps (16)
Weird.. I got the Props passed to ... are of the type cljs.core/PersistentVector instead of a map. Perhaps you meant to map the component over the props?
message when I forgot to coerce the :item/id to a uuid in :will-enter's call to route-immediate
.
Just a hypothesis: Do you have initial state configured? If not, then it may be happening on the first render. Try just adding :initial-state {}
to your component config
Yes, initial state was configured using template mode like that. Guess that's not it :man-shrugging: but I thought the same at first because it has happened to others in the Slack history here.
Are there any examples of custom theming with SemanticUI and Fulcro out in the wild, e.g., on Github?
Hello. I am struggling with setup. When I follow the readme on the fulcro-rad-demo, and navigate to localhost:3000, all I get is a blank page? Is this right?
it should not be a blank page.
Did shadow-cljs successfully compile it? Are you running shadow-cljs watch?
the clj repl
2022-10-19T16:37:45.823Z grim INFO [com.fulcrologic.fulcro.server.config:54] - Reading configuration file at config/defaults.edn
2022-10-19T16:37:45.825Z grim INFO [com.fulcrologic.fulcro.server.config:54] - Reading configuration file at config/dev.edn
2022-10-19T16:37:45.826Z grim INFO [com.example.components.config:14] - Loading config config/dev.edn
I 2022-10-19T16:37:45.827Z _rad.database-adapters.datomic:-345 - Starting database :main
W 2022-10-19T16:37:46.024Z _rad.database-adapters.datomic:-283 - ==========================================================
W 2022-10-19T16:37:46.025Z _rad.database-adapters.datomic:-284 - Database mocking enabled. No database changes will persist!
W 2022-10-19T16:37:46.025Z _rad.database-adapters.datomic:-285 - ==========================================================
I 2022-10-19T16:37:46.025Z _rad.database-adapters.datomic:-286 - Adding form save support to database transactor functions.
I 2022-10-19T16:37:46.081Z _rad.database-adapters.datomic:-295 - Finished connecting to and migrating database.
I 2022-10-19T16:37:46.082Z _rad.resolvers:- 45 - Building attribute resolver for :account/all-accounts
I 2022-10-19T16:37:46.082Z _rad.resolvers:- 45 - Building attribute resolver for :account/invoices
I 2022-10-19T16:37:46.083Z _rad.resolvers:- 45 - Building attribute resolver for :category/all-categories
I 2022-10-19T16:37:46.083Z _rad.resolvers:- 45 - Building attribute resolver for :item/all-items
I 2022-10-19T16:37:46.083Z _rad.resolvers:- 45 - Building attribute resolver for :invoice/all-invoices
I 2022-10-19T16:37:46.083Z _rad.resolvers:- 45 - Building attribute resolver for :invoice-statistics/date-groups
I 2022-10-19T16:37:46.084Z _rad.resolvers:- 45 - Building attribute resolver for :invoice-statistics/gross-sales
I 2022-10-19T16:37:46.084Z _rad.resolvers:- 45 - Building attribute resolver for :invoice-statistics/items-sold
I 2022-10-19T16:37:46.084Z _rad.resolvers:- 45 - Building attribute resolver for :line-item/category
I 2022-10-19T16:37:46.085Z _rad.database-adapters.datomic:-385 - Building ID resolver for :account/id
I 2022-10-19T16:37:46.093Z _rad.database-adapters.datomic:-385 - Building ID resolver for :address/id
I 2022-10-19T16:37:46.093Z _rad.database-adapters.datomic:-385 - Building ID resolver for :category/id
I 2022-10-19T16:37:46.094Z _rad.database-adapters.datomic:-385 - Building ID resolver for :item/id
I 2022-10-19T16:37:46.094Z _rad.database-adapters.datomic:-385 - Building ID resolver for :invoice/id
I 2022-10-19T16:37:46.094Z _rad.database-adapters.datomic:-385 - Building ID resolver for :line-item/id
I 2022-10-19T16:37:46.095Z _rad.database-adapters.datomic:-385 - Building ID resolver for :file/id
I 2022-10-19T16:37:46.113Z com.example.components.server:- 13 - Starting webserver with config {:port 3000}
I 2022-10-19T16:37:46.115Z development:- 36 - SEEDING data.
cljs repl
shadow-cljs - HTTP server available at
shadow-cljs - server version: 2.15.12 running at
shadow-cljs - nREPL server started on port 9000
shadow-cljs - watching build :main
[:main] Configuring build.
[:main] Compiling ...
GUARDRAILS IS ENABLED. RUNTIME PERFORMANCE WILL BE AFFECTED.
Mode: :runtime Async? false Throw? false
Guardrails was enabled because the CLJS Compiler config enabled it
WARNING: parse-long already refers to: #'clojure.core/parse-long in namespace: com.fulcrologic.rad.type-support.integer, being replaced by: #'com.fulcrologic.rad.type-support.integer/parse-long
WARNING: abs already refers to: #'clojure.core/abs in namespace: cljc.java-time.duration, being replaced by: #'cljc.java-time.duration/abs
WARNING: parse-long already refers to: #'clojure.core/parse-long in namespace: com.fulcrologic.rad.form, being replaced by: #'com.fulcrologic.rad.form/parse-long
[:main] Build completed. (933 files, 0 compiled, 0 warnings, 6.04s)
That all looks fine
do you have errors in your browser console?
I do:
main.js:1452 ReferenceError: JSJoda is not defined
at shadow$provide.module$node_modules$$js_joda$timezone$dist$js_joda_timezone_10_year_range_min (js-joda-timezone-10-…range.min.js:6:4096)
at shadow.js.jsRequire (js.js:66:18)
at shadow.js.require (js.js:113:20)
at eval (com.fulcrologic.rad.…ar_timezone.js:2:93)
at eval (<anonymous>)
at goog.globalEval (main.js:486:12)
at env.evalLoad (main.js:1560:12)
at main.js:2198:12
main.js:1454 The above error occurred when loading "com.fulcrologic.rad.type_support.ten_year_timezone.js". Any additional errors after that one may be the result of that failure. In general your code cannot be trusted to execute properly after such a failure. Make sure to fix the first one before looking at others.
core.cljc:186 2022-10-19T16:39:35.605Z INFO [com.fulcrologic.rad.form:477] - NOTE: com.example.ui.file-forms.FileForm does not have a route prefix and will only be usable as a sub-form.
core.cljc:186 2022-10-19T16:39:35.696Z INFO [com.fulcrologic.rad.form:477] - NOTE: com.example.ui.master-detail.AccountForm does not have a route prefix and will only be usable as a sub-form.
timbre_support.cljs:80 INFO [com.example.client:51] - Starting App
shadow.module.main.append.js:4 An error occurred when calling (com.example.client/init)
main.js:1452
JsJodaException {message: 'unsupported ZoneId:America/Los_Angeles', stack: 'DateTimeException: unsupported ZoneId:America/Los_…le.main.append.js:4:26)\n at eval (<anonymous>)', toString: ƒ}
main.js:1454 The above error occurred when loading "shadow.module.main.append.js". Any additional errors after that one may be the result of that failure. In general your code cannot be trusted to execute properly after such a failure. Make sure to fix the first one before looking at others.
util.cljs:136 CLJS DevTools: some custom formatters were not rendered.
browser.cljs:20 shadow-cljs: #5 ready!
did you use yarn or npm?
the yarn.lock contains the correct deps to avoid that error, did you delete it?
(the yarn.lock that is part of the demo repo)
I ran into this exact issue in my fulcro rad project and that's how I got around it. I haven't taken the time to really dig into it though, so I can't be much more help with it.
awesome! no problem
It does, but I don't think it's really "production ready".
oh, yes- I think it is prefilled, is it not?
from the readme: Login is
with password letmein
.
huh, seeing the same error here. either installing deps via yarn
or npm install
i get the JSJoda is not defined
error
ok i fixed it by adding a preload before fulcro.inspect.preload
:
:preloads [com.example.preload com.fulcrologic.fulcro.inspect.preload]
com/example/preload.cljs:
(ns com.example.preload
(:require
["./globalJoda"]))
com/example/globalJoda.js:
global.JSJoda = require('@js-joda/core');
kinda hacky but works 🙃.. i'm sure there's a better way.Hey all, is there a way to run some code on route-change for an entire router? I want to transact a mutation whenever someone switches between routes but don't want to have to call the function in the :will-enter
for every single route. Is there a way to accomplish this?
I guess you could create your own defsc-like macro which copies the original but just sets :will-enter
to whatever you like as in RAD's https://github.com/fulcrologic/fulcro-rad/blob/develop/src/main/com/fulcrologic/rad/container.cljc#L171.
Might be nice to have the ability to change the defrouter's state machine using a similar mechanism as fo/machine
and ro/machine
so you could overwrite parts of the https://github.com/fulcrologic/fulcro/blob/55cd2d4b2a2f60e9d829ec19c2035f19cdfb8588/src/main/com/fulcrologic/fulcro/routing/dynamic_routing.cljc#L381 with your own logic more easily.
But I'm curious if there's a prescribed method already available.
RAD reports also set up their own :will-enter in defsc-report: https://github.com/fulcrologic/fulcro-rad/blob/2e668d5ce271299c5efc4f2748a3b021534d5a6a/src/main/com/fulcrologic/rad/report.cljc#L600-L602