This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-06-17
Channels
- # announcements (3)
- # beginners (107)
- # calva (13)
- # clj-kondo (5)
- # cljsrn (21)
- # clojure (99)
- # clojure-australia (8)
- # clojure-dev (51)
- # clojure-europe (108)
- # clojure-nl (1)
- # clojure-portugal (3)
- # clojure-spec (9)
- # clojure-uk (10)
- # clojurescript (147)
- # component (7)
- # conjure (5)
- # core-async (2)
- # cursive (11)
- # datomic (11)
- # emacs (14)
- # graalvm (163)
- # graalvm-mobile (317)
- # honeysql (15)
- # introduce-yourself (4)
- # jobs (3)
- # lambdaisland (1)
- # lsp (19)
- # luminus (3)
- # malli (17)
- # off-topic (10)
- # pathom (11)
- # reagent (10)
- # remote-jobs (2)
- # ring (1)
- # shadow-cljs (22)
- # test-check (2)
- # testing (5)
- # tools-deps (39)
Dear Calva friends. This upstream issue (on VS Code) is causing confusion for new Calva users. The VS Code team is very driven by votes (thumbs up) on issues, so please throw yourself at this one and give it thumbs up:https://github.com/microsoft/vscode/issues/126306
Hi, is it normal that I can't compile functions in debug mode, or use breakpoint, inside an cljs app? Using cljc files it works. Got a failed compiling constant: #'cider.nrepl.middleware.debug/breakpoint-if-interesting; clojure.lang.Var is not a valid ClojureScript constant.
Thanks!
Hello @schad.alexis , Iām not completely sure I understand the problem, but if it is about the debugger, it only works in Clojure. That makes it work for cljc
files if you are backing those with a Clojure REPL. You can toggle if they should be backed by a Clojure or ClojureScript REPL using a command, and also with the cljc/clj
button in the statusbar.
I tested it a bit more, with two REPL (one cljs and one clojure). I can switch as expected within a .cljc file, but in a .cljs, it is forced to the cljs REPL. I would have expected to be able to debug functions of "pure clojure" (without any JS dependency). Is it possible to force the clojure REPL in an cljs file?
(For the initial question of the debugger in cljs, I've juste noticed the Note in the doc, I was just scrolling without reading it...)
I try to factor things so that I can cljc files for cross platform code, but I havenāt entertained this use of a Clojure REPL for ClojureScript filesā¦ I think it might often come down to that you still have some ns
things you need to load and if it is a cljs file chances are that the Clojure REPL will not be able to load the file.
The output/REPL window is treated as a cljc file, however, so you can try debugging things thereā¦
yes the clojure cant parse the whole file, for sure, espacially the ns
with JS requirements. I also have cljc files for the logic but my cljs are for reagent components (I'm making a web app). Thanks for the answer, now I understand well the why, I will find a solution (maybe putting the maximum code in cljc files, or just using console.log to debug cljs functions).