vshaxe / hashlink-debugger

Visual Studio Code Debugger for Haxe/HashLink applications
https://hashlink.haxe.org/
MIT License
57 stars 23 forks source link

incorrect error message: "Please use a Haxe configuration that targets HashLink (found target "js" instead)." #113

Closed tromero closed 9 months ago

tromero commented 1 year ago

I set up my compile hxml to build both hl and js at the same time. It resulted in the error: Please use a Haxe configuration that targets HashLink (found target "js" instead)., unless i comment out my js build args.

This is probably not the best approach (i haven't figured out a way to make the config change which target gets built other than having two compile hxml files, recommendations would be appreciated), but seems like the debugger should have worked with this simple setup.

my compile.hxml looks like this:

--class-path src
-lib heaps
--dce full

--each

# desktop
-lib hldx
# -lib hlsdl
-hl bin/stickychunks.hl
-main Main
-debug

--next

# web
-js bin/stickychunks.js
-main Main
-debug

and launch.json:

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "chrome",
            "request": "launch",
            "name": "Launch Chrome against localhost",
            "url": "file://${workspaceFolder}/index.html",
            "webRoot": "${workspaceFolder}",
            "preLaunchTask": {
                "type" : "haxe",
                "args" : "active configuration"
            }
        }
        ,
        {
            "name": "HashLink",
            "request": "launch",
            "type": "hl",
            "cwd": "${workspaceFolder}",
            "preLaunchTask": {
                "type": "haxe",
                "target" : "${workspaceFolder}/bin/stickychunks.hl",
                "args": "active configuration"
            }
        }
    ]
}
tromero commented 1 year ago

The issue also does not occur if the .hl file is the last output in compile.hxml.

jrdoughty commented 9 months ago

Did this ever get resolved, I have it as well

ncannasse commented 9 months ago

You can instead have: