Fork me on GitHub

Hi, Could you please help me to setup Spacemacs for debugging ClojureScript code directly from within Spacemacs? (I know CIDER does not support ClojureScrpit.) I found some instructions for using LSP. I tried it, with no avail... (details in thread) Of course, other options are most welcome :-) Thanks in advance, --Leandro


I know it's also possible to debug a ClojureScript project with the Developer Tools of most browsers (Firefox, Chromium...). However, I would like to be able to do that directly from Spacemacs itself. Would you know of such a way? I have only found one, and cannot make it work... Whereas I found a link[1] where they show how to use dap-mode to debug ClojureScrip under vanilla Emacs, I haven't been able to adapt these instructions to work under Spacemacs... [1]: This is my current setup [2]. [2]: This is what I have done so far, following the instructions from[1][: 1) Create a launch.json in the project root [DONE] 2) Install Google Chrome Debug Adapter via M-x dap-chrome-setup [FAILS] I cannot install the adapter. It seems the command is obsolete[3]. [3]: I get the following error: "helm-M-x-execute-command: Have you loaded the ‘chrome’ specific dap package?" How should I load that package? In a reply to my original Zulip message [4], @U05254DQM mentioned a bug w.r.t. the package download [4]. That being said, the command M-x dap-chrome-setup, as mentioned in [1], seems not to exist... [4]: Thank you in advance, Leandro

Drew Verlee20:05:19

Fwiw. Nothing has ever worked for me in terms of a debugger w/ step, inspect, etc... I just def vars. You can set break points on the js in the browser. But i rarely do.


thanks for the reply


does everybody do that? I thought there were more sophisticated ways to debug ClojureScript...

Drew Verlee23:05:17

Well, in a way, you can debug clojure with clojure using the repl. So it's not really lacking, just different. The downside is you can't step though code as easily. I'll say that i think that's a weakness, but most fe frameworks would probably make it impossible regardless...


I haven't tried a step debug tool for ClojureScript as I rarely write complex algorithms in the front end. Even with Clojure, the Cider debug tool is not the first thing I reach for. Usually the result of calling a function in the REPL gives me an idea what's wrong. I use the Cider inspector if it's a large or nested data structure (or clojure.pprint) If the cause is not obvious from calling the function I'll break down that function and evaluate just the parts of it (using some mock values) If the ClojureScript code it is platform neutral (no JavaScript interoperability) I can always write that code in a .cljc file and use the Cider debug tool and a Clojure REPL. And then there is always println or the more sophisticated tap> approach (with a tool like portal).