Fork me on GitHub
#calva
<
2023-07-18
>
AJ Snow18:07:42

problem: I'm having trouble getting my calva instance to jack into my shadow-cljs project. solution: unsure, but I got it working using the instructions below. the jack-in process for cljs can be a bit complicated, but it's possible to do it via a single command in vscode. steps • run the jack-in command option from the command palette • select your project (shadow-cljs) • select your build, wait a minute • select which build you want to connect to. note that if I select the build that I selected in the previous step (e.g. app) it doesn't work. instead, since my build targets node, I select node-repl doing that allows it to jack in. the steps will be different based on your shadow-cljs project builds. also, you may need cider-nrepl as a dependency. here is a snippet of my shadow-cljs.edn file

:dependencies [[cider/cider-nrepl "0.32.0-alpha1"]]

 :builds
 ;; 
 {:app {:target :node-script
        :main router/entry
        :output-to "public/out/entry.js"
        :output-dir "public/out/resources"
        :dev-tools {:repl-init-ns prototyping
                    :repl-pprint true}}

pez19:07:30

I’m not sure if you can connect to a :node-script build. Seems like that should work, and might depend on what the app does. Maybe a question for #C6N245JGG.

AJ Snow18:07:48

problem: clojure.lang.Var is not a valid ClojureScript constant or something else when trying to do debugging on a top level form in clojurescript solution: I don't think there is one. it looks like debugging works for clj files, not cljs. refer: https://clojurians.slack.com/archives/CBE668G4R/p1674775822168919?thread_ts=1674775346.064909&amp;cid=CBE668G4R

pez19:07:50

Indeed. Calva’s debugger only works for Clojure.