Fork me on GitHub
#calva
<
2020-12-06
>
elarouss18:12:43

Hi, I’m trying to use Calva’s debugger, it works when evaluating code (the execution breaks on #break), but not when running the application (a web server using Pedestal & Lacinia), do i need to configure something?

bringe02:12:33

Hello, how are you running the service and what action are you taking that results in the breakpoint not being hit? Are you starting it from the repl? Then are you hitting some endpoint of the service? If so, do you happen to be loading the file between setting the breakpoint (and evaluating the function where the breakpoint is) and hitting the endpoint? This could result in the breakpoint not being hit because of the load-file operation. If you have eval-on-save enabled this is also loading the file on save and will make the breakpoint not be hit afterward. If you provide detailed steps for when it's not working, I can better troubleshoot.

elarouss09:12:46

Thank you, so basically i’m putting the break point in a Lacinia resolver and using Integrant to manage the state, So I tried to put break# then reload the app using (reset) then call the endpoint that triggers that resolver, but it didn’t stop on the break. i tried to do the same, without the (reset) , but still it didn’t work. for the Eval On Save option it’s off Actually I tried Emacs’s cider debugger and it has the same behavior. P.S: I used Cursive’s debugger before, and it worked for me

bringe16:12:23

Interesting. So it seems to have something to do with how things are evaluated and how cider-nrepl's debug middleware works (Calva and Cider use the same debug middleware). I haven't worked with lacinia or Integrant, but if you provide a sample project or point to some template that this can be reproduced in, in an issue, that would help. Maybe we can figure out why this behavior occurs and document it or find a workaround.

elarouss19:12:17

I’ll try to make a minimal sample project, thank you 🙏

bringe20:12:35

Thank you!