Fork me on GitHub
#calva
<
2021-02-26
>
richiardiandrea19:02:42

Hi all, I am wondering whether I need to do anything on top of adding #dbg before forms for Calva to debug...I read the manual and the caveats but the breakpoints don't seem to be hit

bringe19:02:24

Hi. Can you provide an example that's not working for you?

richiardiandrea20:02:10

yes I have a handler that it is never call and I am doing this in the function body

(let [..stuff...]

#break
      (event-bus/publish event-bus (make-changed-event id)))

bringe22:02:56

Are you evaluating the handler directly from the repl or calling it via http? The latter can be tricky to get breakpoints to work with I think, though I have done it before if I remember correctly.

bringe22:02:57

It can be hard to debug these types of things without a solid repro case. If it involves hitting an endpoint via http, then if you could make a small repro project, that I can pull down and repro the issue with, and link it in an issue in the Calva repo, that would be best. There may be some trick to it that needs to be documented.

richiardiandrea00:02:48

Yeah it is exactly hitting via http - not REPL, cause that's the use case the most devs want to do (cider user myself but debugging for others 🙂) In any case thanks for your help, repro case seems too much work for me at the moment, maybe later on

bringe02:02:02

Ok, understood. This isn't the first time this has come up if I remember correctly, but I don't think we tracked it well before. I remember seeing it work, myself, but I don't try to do this in my usual work. I think this has something to do with how things are evaluated/loaded. If it works in Cider we should be able to make it work in Calva, since Calva uses cider-nrepl for much of its debugger functionality.

bringe04:02:44

I made an issue for this so I can investigate soon. I'll try to repro myself. May ping you at a later date for more info or to test a change, if you're up for it. simple_smile

richiardiandrea04:02:07

Please do, I am open to experimenting 😃

richiardiandrea04:02:17

And thanks a lot!

richiardiandrea04:02:55

Just as an FYI the code I inherited is a duct app with a pedestal http server...many moving parts I know

👍 1