This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-10-04
Channels
- # aleph (23)
- # announcements (1)
- # babashka (21)
- # beginners (70)
- # biff (3)
- # cider (8)
- # clj-kondo (45)
- # clj-yaml (9)
- # clojure (69)
- # clojure-europe (82)
- # clojure-nl (1)
- # clojure-norway (2)
- # clojurescript (34)
- # conjure (19)
- # core-typed (6)
- # cursive (2)
- # events (5)
- # fulcro (55)
- # honeysql (1)
- # integrant (18)
- # jobs (1)
- # lsp (124)
- # malli (10)
- # meander (1)
- # off-topic (26)
- # polylith (8)
- # reagent (7)
- # releases (1)
- # remote-jobs (1)
- # sci (2)
- # shadow-cljs (19)
- # squint (5)
- # vim (17)
- # xtdb (31)
I’m using shadow.lazy/loadable
to lazily load some modules. If I naviagte to the page localhost:4000/utils
, it will properly load localhost:4000/js/routes.utils.js
. If I navigate to localhost:4000/utils/example
, it is failing to load because it’s looking for the file at localhost:4000/utils/js/routes.utils.js
. I have asset path configured to /js
- how do I configure the equivalent for lazily loaded modules?
you sure you haven't configured it to js
? it should be using the :asset-path "/js"
if actually set like that
(defn component [loadable]
(let [lazy (react/lazy
#(-> (lazy/load loadable)
(.then (partial to-hot-react-component loadable))))]
(fn [& props]
(react/createElement lazy #js {:props props}))))
(defn get-lazy [namespace]
`(captain.util.lazy/component (shadow.lazy/loadable ~namespace))))
then I don't know. the behavior you described points to :asset-path "js"
, "/js"
shouldn't do this
No service workers on this project yet, I reset shadow-cljs and ran it in a different browser and it’s the same problem
Do you know which module builds the path from the module name? I’ll take a look but that could save some time hehe
very weird. In my build directory, there is the expected structure. My console is somehow showing a bunch of sources available under /utils
:thinking_face:
$ tree build
build
├── 1664911033746
│ ├── captain.css
│ └── js
│ ├── captain.docs.routes.about.js
│ ├── captain.docs.routes.about.me.js
│ ├── captain.docs.routes.index.js
│ ├── captain.docs.routes.utils.$util.js
│ ├── captain.docs.routes.utils.index.js
│ ├── captain.docs.routes.utils.js
│ ├── captain.js
│ ├── cljs-runtime
│ │ ├── applied_science.js_interop.impl.js
│ │ ├── applied_science.js_interop.impl.js.map
│ │ ├── applied_science.js_interop.js
│ │ ├── applied_science.js_interop.js.map
│ │ ├── captain.app.js
│ │ ├── captain.app.js.map
..................................
│ │ ├── shadow.util.js
│ │ └── shadow.util.js.map
│ ├── manifest.edn
│ ├── module-loader.edn
│ ├── module-loader.json
│ ├── quartermaster.js
│ └── shared.js
├── index.html
└── index.html.clj
3 directories, 859 files