Debugging convex functions in VSCode
I've seen that it's possible to put debug statements inside convex functions, but I haven't managed to pause on breakpoints in VSCode. Is this possible?
My reference so far: https://docs.convex.dev/functions/debugging
Debugging | Convex Developer Hub
Debugging is the process of figuring out why your code isn't behaving as you
9 Replies
It's only possible when running the functions from local tests:
https://docs.convex.dev/functions/testing#debugging-tests
When running the functions in Convex cloud
console.log
is your main debugging tool.Testing | Convex Developer Hub
Automating the testing of your Convex functions is easy.
What about when using the local backend? This sounds to me pretty similar to emulating firebase cloud functions where it's also possible to put breakpoints
The local backend doesn't have this ability atm.
okay no worries, I'd appreciate knowing what kind of priority this has or where this falls on your roadmap if at all 🙂
We haven't had that many folks ask us for proper debugger support.
I have personally found working on large codebases that about 90% of the time logs are a better tool for me than the debugger, but this can depend on the nature of the code you're debugging.
Any reason why the testing path doesn't work for you?
I guess I'm more used to the debugger route but I'll give a fair shot to using logs for now
Yeah I'd recommend setting up a test and attaching a debugger to that test as opposed to trying to attach a debugger directly to a local backend -- tests are completely within JS, so all the usual JS debugging tools are available. The local backend is running both your JS code and Rust code, so proper debugging is a little trickier
WAIT SARAH IS THAT YOU? omg what a way to cross paths again 🤯 (i'm david from rsi '15)
Lol yes, welcome 🙂 We've come a long way from high school nerd camp (but I guess not actually that far since this is a tech discord)