Fork me on GitHub
#shadow-cljs
<
2023-11-13
>
olive15:11:07

i'm migrating a codebase from an old lein-figwheel setup to a shadow-cljs setup and i'm hitting a strange compilation error

aborted par-compile, [:shadow.build.classpath/resource "myapp/core.cljs"] still waiting for #{myapp.pages}
and myapp.pages is waiting on another file, and that one is waiting on myapp.spec, until finally the "leaf node" that the compiler is waiting on, myapp.constants, just def's a few things, no requires, no imports, no macros, just a few keywords and ints. when i copy the contents of myapp.constants into myapp.spec and remove the require, it compiles fine. interestingly, other files also require myapp.constants with no problem. this fix is fine while getting set up, but i'm worried it might happen again in a more difficult to fix way down the line

thheller17:11:29

which version do you use? a bug with this was fixed recently

olive17:11:09

my shadow-cljs info says shadow-cljs version: 2.26.0

thheller19:11:13

the problem was that a namespace could require itself. so (ns myapp.core (:require [myapp.core]))

thheller19:11:45

not aware of any other issues at this time. par-compile means it is compiling using multiple threads, that needs coordination. so if something is messed up with the namespace requires it can get stuck.

thheller19:11:57

from your description everything sounds fine, so not sure what the cause could be

olive19:11:55

yeah, it probably shouldn't be a namespace requiring itself issue because the problem file has no requires and is required by other files and successfully compiles, it just gets hung up on this one require

olive19:11:57

super strange!

olive19:11:47

i think i figured it out

olive19:11:43

[bro.model_builder.constants :as c]
the namespace it was importing had an underscore for some reason. no idea why lein-figwheel let that compile

thheller19:11:10

hmm there is a check for that. thats odd.

thheller19:11:38

ah wait in the require. hmm yeah there might be no check for that, only in the ns itself

thheller19:11:15

yep, can reproduce

olive19:11:55

ahh, i see. thank you so much for your help! very glad i finally got that resolved so i can recommend without reservation that we switch to shadow. thank you so much for all your hard work in general, i love shadow-cljs!

thheller19:11:47

thanks for the report, these things can be frustrating to figure out. glad you got it so quick. :P