Fork me on GitHub
#clojurescript
<
2021-10-03
>
Carlo08:10:51

Is anyone able to use dap for clojurescript like described in https://emacs-lsp.github.io/lsp-mode/tutorials/debugging-clojure-script/ ?

Carlo09:10:13

@yyoncho using this config when trying to start dap-mode

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "chrome",
            "request": "launch",
            "name": "DAP clojurescript",
            "url": "",
            "sourceMaps": true,
            "webRoot": "${workspaceFolder}",
            "sourceMapPathOverrides": {
                "*": "${workspaceFolder}/src/main/*"
            },
            "runtimeExecutable": "/run/current-system/sw/bin/google-chrome-stable",
            "runtimeArgs": [
              "--new-window",
              "-user-data-dir=\"${workspaceFolder}/DevProfile\"",
              "--remote-debugging-port=9222",
              "--disable-background-networking"
            ]
        }
    ]
}
gives me back crbug/1173575, non-JS module files deprecated. and chrome says This site can't be reached

Carlo09:10:28

I have partially solved this issue by adding:

:dev-http
 {3000 {:root "public" :handler user/app}}
to my shadow-cljs configuration, and pointing the url in the dap config to 3000 instead. So now I'm able to get in the debugger, but it doesn't seem to work

Carlo09:10:49

restarting emacs solved the residual problems I was having 🎉

p-himik09:10:29

A few times, to people having problems with MUI and shadow-cljs I have suggested to set :output-feature-set :es5 which appeared to work. But seems like it's not the right way to do it. The correct fix would be to use :js-options {:entry-keys ["module" "browser" "main"]} as per https://clojurians.slack.com/archives/C03S1L9DN/p1633252216062300?thread_ts=1633094777.021800&amp;cid=C03S1L9DN

👍 1
1
thheller09:10:23

(note that :es5 does work and the end result is likely the same, only downside is that more stuff might get polyfilled than needs to be)