Glad to see this up and running again. I missed it very much for the couple of hours it was broken the same way for me, so ... good job on that one. :)
Not seeing it with Krastorio 2. It looks like some other mod has declared a global variable 'debug', overriding the built in LUA debug object. :(
FWIW, if that actually happened then Factorio mod sandboxing is busted, and you should report it as a bug. Sounds like you figured out why, and it wasn't that, but ... mods are not supposed to be able to see or do anything to the Lua environment of other mods. :)