Welcome! Please see the About page for a little more info on how this works.
as the title suggests, def appears to pass through without doing anything.
i.e. "(def x)" succeeds but "(def x 10)" fails because "Cannot read properties of undefined (reading 'x')"
article here: https://clojurescript.org/guides/self-hosting
suggests :simple optimization should work
to reproduce: https://github.com/sstraust/ClojureDefRepro (see comments for instructions)
I didn't run the code, but my guess is that the code is compiled to emit
cljs.user.x = 10;
with cljs.user not being defined yet. Thus it fails when you try to run this since it tries to set x on cljs.user. Try creating cljs.user first, or by supplying an already existing :ns option when compiling.
cljs.user
x
:ns