This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-02-26
Channels
- # asami (5)
- # babashka (9)
- # beginners (19)
- # calva (14)
- # cider (13)
- # clj-kondo (9)
- # cljfx (2)
- # clojure (51)
- # clojure-bay-area (1)
- # clojure-europe (26)
- # clojurescript (23)
- # code-reviews (7)
- # core-async (1)
- # datahike (4)
- # datalevin (3)
- # emacs (2)
- # kaocha (2)
- # malli (6)
- # nrepl (3)
- # polylith (3)
- # re-frame (15)
- # reveal (1)
- # shadow-cljs (13)
- # tools-deps (6)
Trying to debug re-frame app. Thought I'd try re-frame-10x. 10x keeps throwing an error:
[:dev] Build failure:
Invalid configuration
-- Spec failed --------------------
{:target :browser,
:compiler-options
{:closure-defines
{re-frame.trace.trace-enabled? true,
day8.re-frame.tracing.trace-enabled? true}},
:build-id :dev}
should satisfy
has-either-chunks-or-modules?
Trying to figure out why this is happening because I've copied the config directly over from re-frame-10x's github page (other than adding the :target :browser to the :dev build because it was complaining about not having a :target). Any ideas what "has-either-chunks-or-modules?" means? The relevant spec bottoms out there with no idea of what that definition is. Or, even better, if someone could tell me how to fix my shadow-cljs.edn file to make this work, that would be great.Adding shadow-cljs.edn file:
;; shadow-cljs configuration
{:source-paths
["src"]
:dependencies
[[reagent "1.1.0"]
[re-frame "1.3.0-rc2"]
[re-com "2.13.2"]
[day8.re-frame/tracing "0.6.2"]
[day8.re-frame/re-frame-10x "1.2.2"]]
:dev-http {32457 "public"}
:builds
{:client
{:target :browser
:output-dir "public/js"
:asset-path "."
:modules
{:client
{:init-fn atlas.main/main!}}}
:devtools
{:preloads [day8.re-frame-10x.preload]
:target :browser}
:dev
{:target :browser
:compiler-options
{:closure-defines
{re-frame.trace.trace-enabled? true
day8.re-frame.tracing.trace-enabled? true}}}
:release
{:target :browser
:build-options
{:ns-aliases
{day8.re-frame.tracing day8.re-frame.tracing-stubs}}}}}
Thanks in advance for any help anyone can give me.Wait. Why are you adding stuff from re-frame-10x's shadow-cljs.edn
into your own shadow-cljs.edn
?
Ah, after checking out the README I think I know what you mean.
That section doesn't mean you need to copy the entire block into your shadow-cljs.edn
. It specifically talks about only adding :closure-defines
and :preloads
in its description.
Because my shadow-cljs.edn file was relatively minimal with only a :client build. I figured by adding the re-frame-10x stuff, I could configure the build to work with 10x.
Something like this:
:builds
{:client
{:target :browser
:output-dir "public/js"
:asset-path "."
:modules
{:client
{:init-fn atlas.main/main!}}}}}
Basically, a very minimal set of directives taken from the shadow-cljs documentation.Notice how your original config has :modules
but your modified config does not.
And the spec function that errors out on the modified config is called has-either-chunks-or-modules?
.
Yeah. My assumption is that the modules defined in the :client config would be inherited. I think I sort of (emphasis on the sort of) understand what the config is saying in the :devtools and :dev sections, but maybe I need to add the :module definition there, too.
• You don't need :target :browser
under the :devtools
key
• Format your code differently, ideally not manually but with auto-formatter. Your braces are in the wrong places - shadow-cljs thinks that :dev
is a build, whereas it, along with :release
, should be within the :client
build.