[2.1.17] Debugger does not load correct source file when stepping
Posted: Sat Sep 05, 2026 7:21 am
FMTK 2.1.9
Stepping (using F7) through a mod. After receiving a `on_pre_player_mined_item` event, the debugger stops on this breakpoint:
This code lives in "scripts/controller.lua", lines 233-241:
Pressing F7 should step the debugger to this function. The execution actually does so, however, vscode shows this:
which is line 234 (correct!) but not in scripts/controller.lua but in "scripts/event-setup.lua" (which is the same file that "serialize_config" is in)
Stepping through the code using F7 gets the debugger to the end of the function correctly while showing the wrong source file:
(this is line 240 in scripts/event-setup.lua, not line 240 in scripts/controller.lua, which is the code that the debugger has executed)
Pressing F7 here returns correctly.
dap trace log attached. The relevant parts start around ""seq":6932" (line 6961).
Stepping (using F7) through a mod. After receiving a `on_pre_player_mined_item` event, the debugger stops on this breakpoint:
This code lives in "scripts/controller.lua", lines 233-241:
Pressing F7 should step the debugger to this function. The execution actually does so, however, vscode shows this:
which is line 234 (correct!) but not in scripts/controller.lua but in "scripts/event-setup.lua" (which is the same file that "serialize_config" is in)
Stepping through the code using F7 gets the debugger to the end of the function correctly while showing the wrong source file:
(this is line 240 in scripts/event-setup.lua, not line 240 in scripts/controller.lua, which is the code that the debugger has executed)
Pressing F7 here returns correctly.
dap trace log attached. The relevant parts start around ""seq":6932" (line 6961).