How do I go about debugging this? It happened in dev after I restarted my JVM. I can send code in dm 😄
Maybe a cache issue? Have you tried deleting .shadow-cljs and restarting your JVM? Also performing a hard refresh in your browser may help.
No change 😕
There's also this error
Ok this looks like a case of destructuring an electric e/defn or e/fn without calling it first. Something like this:
(let [[a b] ElectricFn] …)
Instead of
(let [[a b] (ElectricFn)] …)
Or an equivalent.
I’m assuming the issue comes from userland. I’d start by bisecting code change history.Okay, I found the cause. I have a reader-comment
#_#?(:cljs
(add-watch !state :print-diff
(fn [_key _atom old new]
(print-diff old new))))
When I clear the cache and start up the app with the reader-comment included, the error is caused and the app does not work.
When I clear the cache again and start the app up with the reader-comment changed to a semicolon comment, the app starts If I change it to a regular comment it works.
;; #_#?(:cljs
;; (add-watch !state :print-diff
;; (fn [_key _atom old new]
;; (print-diff old new))))
Now, if I start it up with it commented with semicolons and change it to a reader-comment it still seems to work. I guess this is how I got into the state the first place perhaps.
Does this sound like a bug or am I misunderstanding something? 😄 If it's a bug I can make an MVE on Saturday, if that would be useful to you. In any case, thanks for the help :^)
Note to self: commit more often 😅
If this reader-conditional is in a electric e/defn it could explain why client and server are misaligned. Client and server get two different DAGs, which is forbidden in Electric. But the fact that you have it commented with a reader-discard, and also can toggle the comment type after JVM boot, recompile and still get a working program puzzles me. Overall it sounds like a bug, but I cannot tell. AFAIK this is the first time something like this happens, and you seem unblocked. Ping us if it happens again and we’ll look into it.
Will do 😄