I should have same versions… if I type that into a file and evaluate it, it shows it correctly.
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...)
That’s perfectly fine. 😃
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).
If you find a good way to do it, maybe you can write about it somewhere? Either off you have a blog, out it could fit in the Calva docs too
Thanks, yes it was about using the debugger in cljs.
Note to self: We should mention that in the Getting Started REPL.
I was going to share this as well 😄. You beat me to it.