BetterThanTomorrow / calva

Clojure & ClojureScript Interactive Programming for VS Code
https://marketplace.visualstudio.com/items?itemName=betterthantomorrow.calva
Other
1.62k stars 213 forks source link

clojurescript boot sequence continues in failed state when clojurescript build fails #2273

Open dustingetz opened 1 year ago

dustingetz commented 1 year ago

I will try to post a video and repro the next time i catch it happening.

After the failure, the boot sequence continues and bad stuff happens

Reproduction: Unclear but likely macro related or classpath related errors, such as the CLJC namespace entirely fails to load due to a mistaken :require or misconfigured classpath.

This is blocking merging of things like https://github.com/hyperfiddle/electric-starter-app/pull/8 because the only way to get a reliable repl is to just start the app as an ordinary Clojure REPL and manually invoke shadow via userland – which is why the electric starter app is set up like it is here.)

bpringe commented 1 year ago
  • Calva prints Waiting for Shadow CLJS runtimes, start your CLJS app... in a loop
  • When I scroll up to read the ClojureScript error message, Calva will force the REPL scroll state back down to the bottom each tme it prints the above message in a loop – thus making it impossible to debug the clojurescript build failure

I have never seen that or heard of that happening before now 🤔. This is happening with one of the jack-in sequences, or a custom sequence? Pinging @PEZ.

dustingetz commented 1 year ago

It's the standard deps + shadow-cljs boot sequence

PEZ commented 1 year ago

I've not seen this happen either. If we can get our hands on a reproduction we can probably fix it.

FYI, Calva will stop printing those messages about that it is trying to connect after (iirc) 10 attempts.

You could try connecting using the shadow-cljs sequence. It should also fail, but the shadow-cljs diagnostics will then be printed in the jack-in pseudo-terminal instead of the repl window, which might help in diagnosing, especially since the repl window is resetting its scrolling every 5 seconds a while.

dustingetz commented 11 months ago

Here is another example, a missing npm dep causes shadow build to fail but the calva connect sequence continues in failed state

; Evaluating 'afterCLJReplJackInCode'
(do (require 'user) (user/main))
Starting Electric compiler and server...
shadow-cljs - server version: 2.25.2 running at http://localhost:9630
shadow-cljs - nREPL server started on port 9001

👉 App server available at http://0.0.0.0:8080

true
; [:dev] Configuring build.
;
; [:dev] Compiling ...
;
; [:dev] Build failure:
;
; The required JS dependency "@react-three/cannon" is not available, it was required by "pez/three_dee.cljs".
;
; Dependency Trace:
;   user.cljs
;   dustingetz/boomtip_driver.cljc
;   pez/three_dee.cljs
;
; Searched for npm packages in:
;   /Users/dustin/src/seaquent/sq-visual-twin/spikes/electric-timeline/node_modules
;
; See: https://shadow-cljs.github.io/docs/UsersGuide.html#npm-install
;
clj꞉user꞉> 
; Creating cljs repl session...
; Connecting cljs repl: Electric Timeline...
;   The Calva Connection Log might have more connection progress information.
; Starting cljs repl for: Electric Timeline...
; Cljs builds started
; Please start your ClojureScript app so that Calva can connect to its REPL...
; Waiting for Shadow CLJS runtimes, start your CLJS app...
; Waiting for Shadow CLJS runtimes, start your CLJS app...