VSCode not working on my Macos

Hi everyone,

I’ve been trying to debug my Defold project directly from VS Code but the runtime never stops at any breakpoint. When I launch the same project from the Defold Editor, breakpoints work fine, so I suspect I’m missing something on the VS Code side.

Symptoms

  • No console errors on launch.
  • Breakpoints look “active” but execution just runs past them.
  • Launching the same project via Defold Editor’s Debug :play_button: Run with breakpoint mode works perfectly, so the code itself is debuggable.

Questions

  1. Is there anything obvious missing in my launch.json or build procedure?
  2. Do I need to pass extra flags to dmengine (e.g. --debug or a port number) when launching from VS Code?
  3. Could this be a path-mapping issue on macOS? If so, what’s the correct setting for Defold Kit?
  4. Any known incompatibility between Defold 1.10.1 and the latest Defold Kit extension?

Thanks in advance for any pointers!

Environment

macOS: Sequoia 15.4.1
VS Code: 1.100.2
Defold: 1.10.1
Extension: Defold Kit (latest from Marketplace)|

launch.json (auto created by the Defold Setup Kit)

{
    "configurations": [
        {
            "name": "Defold Kit",
            "type": "lua-local",
            "request": "launch",
            "stopOnEntry": false,
            "verbose": false,
            "internalConsoleOptions": "openOnSessionStart",
            "scriptRoots": [],
            "program": {
                "command": "build/defoldkit/dmengine"
            },
            "args": [
                "build/defoldkit/game.projectc"
            ],
            "windows": {
                "program": {
                    "command": "build\\defoldkit\\dmengine.exe"
                },
                "args": [
                    "build\\defoldkit\\game.projectc"
                ]
            },
            "preLaunchTask": "Defold Kit: Build to Launch"
        }
    ]
}

This is not directly related to vscode, macos or Defold. You’re probably missing the debug configuration for Defold Kit.
Lets ping @astrochili , he might help or you can post an issue:

1 Like

Hi,

Your configuration is fine.

I guess the problem is that the debugger script is not started. Is it?

Breakpoints

To make the breakpoints work ensure that Debugger scripts are added to the workspace. Then add the debugger.script component to your initial collection or add this code to your initial script:

local debugger = require('debugger.debugger')
debugger.start()
3 Likes

Just dropping in to say a huge thank you! :glowing_star:

Adding the debugger.script (I missed that in the docs) in my startup script did the trick—VS Code now halts perfectly on every breakpoint.

Really appreciate the quick help (and the patience) from both of you. Time to get back to coding.