This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-04-02
Channels
- # announcements (2)
- # aws (7)
- # babashka (47)
- # beginners (54)
- # biff (6)
- # calva (14)
- # clojure-europe (7)
- # clojure-germany (2)
- # clojure-japan (4)
- # clojure-norway (5)
- # datalevin (1)
- # deps-new (13)
- # helix (5)
- # hoplon (1)
- # hyperfiddle (12)
- # introduce-yourself (6)
- # joyride (1)
- # malli (2)
- # off-topic (21)
- # polylith (11)
- # re-frame (3)
- # reitit (8)
- # remote-jobs (1)
- # scittle (25)
- # shadow-cljs (20)
- # vim (19)
- # xtdb (4)
From calva only, I get a shadow-cljs error when starting shadow from inside a vanilla deps repl (NOT a calva-enriched shadow-cljs repl). It's not deterministic, sometimes the shadow build succeeds. And the error changes. Running the same main function from a terminal succeeds deterministically always. Any ideas what could cause this?
; Syntax error compiling at (clojure/core/async.clj:463:21).
; No such var: ioc/state-machine
Note that my project does not depend on core.async, this is a shadow stack frameWe are loading shadow like this:
(ns user
; For fastest REPL startup, no heavy deps here, REPL conveniences only
; (Clojure has to compile all this stuff on startup)
(:require [missionary.core :as m]
hyperfiddle.rcf))
; lazy load dev stuff - for faster REPL startup and cleaner dev classpath
(def shadow-start! (delay @(requiring-resolve 'shadow.cljs.devtools.server/start!)))
(def shadow-watch (delay @(requiring-resolve 'shadow.cljs.devtools.api/watch)))
(def shadow-compile (delay @(requiring-resolve 'shadow.cljs.devtools.api/compile)))
(def shadow-release (delay @(requiring-resolve 'shadow.cljs.devtools.api/release)))
(def start-electric-server! (delay @(requiring-resolve 'electric-server-java8-jetty9/start-server!)))
(def rcf-enable! (delay @(requiring-resolve 'hyperfiddle.rcf/enable!)))
and then
(defn main [& args]
(println "Starting Electric compiler and server...")
(@shadow-start!)
...
It seems like a nondeterministic classpath issue
I considered if it could be a shadow-cljs state problem (perhaps due to killing the calva repl terminal with C-C), but the error suggests classpath issue not state issue
Do you recognize the issue? We don't use core.async, this is a transitive dependency from shadow; googling the error doesn't turn up much
i restart the clj repl with ctrl-C in the terminal that hosts the repl
Since it works at a regular REPL, but not via Calva, I wonder if it could be an nREPL thing. See if you can reproduce the problem with a sever started like Calva starts it (there’s a command for copying out the Jack-in command line) and an nrepl client like repl-y or even lein repl :connect
. (Which I think might use repl-y anyway.)
ok, my current hypothesis is yes it would, i am guessing classpath nondeterminism resolving core.async from both cider-nrepl(?) and shadow
haven’t looked into it yet
I suspect a race condition. The symptomatic message is reminiscent of https://ask.clojure.org/index.php/12690/can-async-248-be-reverted which links to https://clojure.atlassian.net/browse/ASYNC-249
(If it's the right "http://ask.clojure.org" ask, it could stand an upvote)