debug
I'm seeing
Connection shut down by remote side while waiting for reply to initial handshake packet
on my MacBook Air M2 when I launch the debugger in VSCodium (I tried VSCode too). Is the debugger supposed to be working?6 Replies
Congrats @richard.kiss, you just advanced to level 1!
I get the same message too, maybe we should file a bug?
GitHub
[BUG]: Debug Mojo File fails in VS Code with `Connection shut down ...
Bug description VS Code can no longer debug Mojo with the max 24.5 SDK installed with Magic CLI. Trying to run Debug Mojo File ends with the error message Connection shut down by remote side while ...
FYI, the nightly mojo extension for VSCode(/Codium) gets a little further. But I get some weird linker errors about missing symbols.
seems like maybe template expansion is not working properly? Or maybe this is happening only in the debugger because it's trying to print something that doesn't get printed during normal execution
I got this working. I had to do a few things:
1. use
Formattable
trait https://docs.modular.com/mojo/stdlib/utils/format/Formattable instead of Stringable
Formattable | Modular Docs
The Formattable trait describes a type that can be converted to a stream of UTF-8 encoded data by writing to a formatter object.
2. change top level
var
constant-ish values to alias
values
(I also started using Optional
instead of my home-grown wrapper, but not clear that was a problem)