This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-12-20
Channels
- # adventofcode (17)
- # announcements (1)
- # aws (1)
- # beginners (102)
- # calva (27)
- # cider (16)
- # clj-commons (34)
- # clj-kondo (33)
- # cljs-dev (5)
- # cljsrn (4)
- # clojure (124)
- # clojure-europe (17)
- # clojure-nl (8)
- # clojure-spec (13)
- # clojure-uk (6)
- # clojurescript (68)
- # datahike (21)
- # datomic (23)
- # emacs (3)
- # fulcro (30)
- # introduce-yourself (6)
- # jobs-discuss (6)
- # lsp (31)
- # nextjournal (3)
- # off-topic (1)
- # other-languages (45)
- # portal (4)
- # re-frame (8)
- # releases (4)
- # shadow-cljs (39)
- # specter (6)
- # tools-build (18)
- # tools-deps (11)
I'm having a problem where advanced compilation and code splitting don't work together. I split my code in a common module and two page-specific ones, but one of the page-specific ones gives an error that $APP.qr
is undefined.
If I switch to simple compilation it works fine, if I compile everything into a single file it also works fine, but with advanced compilation and multiple modules it breaks.
So for now I've just switched to using one single file, but if anyone has any clue what's going on it'd be appreciated
This is the commit that works around it, in case you want to explore the code before/after: https://github.com/NyanCAD/Mosaic/commit/b1f484942e89509246c88b3ad12ad53c445088da
Hey all, awhile back I was having trouble with node modules not getting compiled in, seemingly at random. The frequency this is occuring has increased, leading me to need to remove my .shadow-cljs/builds directory frequently to prevent broken builds. Any clues as to what could cause something like this? or perhaps a clue as to where to start looking? 🙂 Thanks
@pepijndevos run the build with shadow-cljs release frontend --pseudo-names
to get an idea what $APP.qr
might be
$APP.$cljs$spec$alpha$t_cljs$0spec$0alpha11756$$
color me somewhat surprised
Ah! Glad to hear it's a known issue. At the moment my app is relatively small so it's fine to just compile everything in a single module rather than have weird hacks, but as the app grows it's great to know I have that escape hatch available. Thanks!
The app won't load at all, and the js console will show an error like: "Module not provided: Button" .. the last module it displayed that error with was '18', so not sure what that means. It was in production, so didn't have time to really capture much else, had to wipe the builds folder and re-build.
no one else has ever reported issues such as this so I really don't know what this might be about
or partially caching some (eg. multiple modules but having a stale older version in cache)?
I have the local-dev resource root, and a production root, which gets rebuilt from the local-dev one on each build, then a fresh prod build is built into that resource root
compiles via
npx shadow-cljs release app
and the config is setup to use the production root{:app {:target :browser
:output-dir "local-dev/public/js/compiled"
:asset-path "/js/compiled"
:module-hash-names true
:modules {:pnx-web {:init-fn pnx-web.core/init}}
:devtools {:preloads [day8.re-frame-10x.preload]}
:dev {:compiler-options
{:closure-defines
{re-frame.trace.trace-enabled? true
day8.re-frame.tracing.trace-enabled? true}}}
:release {:output-dir "release/public/js/compiled"}
:build-options {:ns-aliases {day8.re-frame.tracing day8.re-frame.tracing-stubs}}}
is app definitionare there any other errors BEFORE you get the module not provided error that would just cause this as a secondary effect?
I'm trying to use an environment variable and could use some help. I have the variable saved in my .bashrc
as OPEN_WEATHER
and in my shadow-cljs.edn
I have: :closure-defines {API-KEY #shadow/env "OPEN_WEATHER"}
but when I try to use it in my app by referring to API-KEY
I get an undeclared var error.
Here is the documentation: https://shadow-cljs.github.io/docs/UsersGuide.html#shadow-env
(ns )
(goog-define VERBOSE false)
and in shdaow-cljs.edn
:dev {:closure-defines { true}}
;; to enable always
:closure-defines { true}
hmmm, I changed it to ...{weather.core/API-KEY #shadow/env...
and still getting the undeclared variable
error...
in (ns weather.core ...)
do you have (good-define API-KEY "dev")
or something similar?