Hi is there a way to debug runtime code? By debugging I mean attaching a debugger and adding breakpoints/inspecting execution. Yesterday I had a hard time figuring out issues with my runtime code which I could have easily solved in debugger mode
Hi @laimonas welcome
Which language do you use with the server runtime? There’s a way to attach the Delve debugger to your Go code but at the moment there’s no way to attach the debugger to the Lua virtual machine inside the game server.
Hey thank you for the reply So far I’ve been writing runtime code in Lua but if theere’s no debugging option for it I’ll probably switch to Go. Are there known technical limitations as to why Lua debugging is not supported and are there plans to support Lua debugging in the future?
@laimonas The main challenge with debugger support for Lua in Nakama is that the virtual machine implementation is in pure Go. We’d need to implement the symbol analysis and debug data capture to support live stack and heap inspection.
Thanks for clarifying
To allow you to test the code, maybe you could use a test-oriented approach by leveraging mocking libraries, such as
ts-auto-mock . It would allow you to stub the runtime calls and assert over their args.
Could you send me the docker & docker compose files because I couldn’t manage to work with delve.
yep, goja (the JS engine Nakama uses) have no debugger support, but they working on it Goja debugger · Issue #294 · dop251/goja · GitHub