Fork me on GitHub
#shadow-cljs
<
2022-06-09
>
barrell07:06:45

I’m running into an issue with lazily-loaded code-split modules. If I try to load an asset from a nested url (`/foo/bar`) it tries to fetch /foo/<asset-path>/<module>. I have the :asset-path set to "/js" which should solve this. Is there any other reason this may be cropping up?

barrell07:06:32

woah weird. All my config option got put into js-options, yet shadow still built all the correct modules nevermind, it’s still early and I apparently can’t read edn. :asset-path is in the right place but still not working

thheller08:06:25

asset-path is the correct option

thheller08:06:32

but how do you load the modules?

barrell09:06:54

shadow.lazy/loadable

barrell09:06:17

then shadow.lazy/load

thheller09:06:03

should be fine. you sure it doesn't actually tries /js and then gets redirect server side or something?

thheller10:06:08

yeah dunno sorry. you can look at the source code to see which path is actually written in the file

thheller10:06:38

just look for js/phrasing. it'll be there in a string

thheller10:06:52

if that is not /js/phrasing somehow the :asset-path isn't applied

mkvlr08:06:12

@thheller thanks for the shadow release with the explicit guava dep! 🙏

thheller09:06:16

hope that helps a little bit