hyperfiddle

oλv 2025-09-10T08:17:44.907049Z

How do I go about debugging this? It happened in dev after I restarted my JVM. I can send code in dm 😄

Geoffrey Gaillard 2025-09-10T08:43:34.017019Z

Maybe a cache issue? Have you tried deleting .shadow-cljs and restarting your JVM? Also performing a hard refresh in your browser may help.

oλv 2025-09-10T08:59:24.363189Z

No change 😕

oλv 2025-09-10T08:59:43.667209Z

There's also this error

Geoffrey Gaillard 2025-09-10T09:12:56.957159Z

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.

👍 1
oλv 2025-09-10T09:35:31.665969Z

oλv 2025-09-10T09:47:10.341249Z

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))))

oλv 2025-09-10T09:48:22.966489Z

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.

oλv 2025-09-10T09:59:19.319189Z

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 :^)

oλv 2025-09-10T09:59:26.131439Z

Note to self: commit more often 😅

Geoffrey Gaillard 2025-09-10T11:02:37.494529Z

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.

oλv 2025-09-10T11:16:14.444759Z

Will do 😄