microsoft / vscode-edge-debug2

This is a VS Code extension which helps you debug your JavaScript Code inside the Edge browser.
Other
37 stars 31 forks source link

runtimeExecutable is not allowed #202

Closed janmechtel closed 3 years ago

janmechtel commented 3 years ago

I'm super excited to attach VS code directly to the Office application (Excel) in my case.

image

I'm struggling to follow the instructions. I'm under the impression i need to attach to a runnin process so I'm trying to do:

            "useWebView": "advanced",
            "runtimeExecutable": "C:\\Program Files\\Microsoft Office\\root\\Office16\\Excel.exe",

But `runtimeExecutable" is then yellow underlined as "is not allowed.

When I launch the debugger in a separate insiders instance:

HTTP GET failed: Error: connect ECONNREFUSED 127.0.0.1:9229
There was an error connecting to http://127.0.0.1:2015/json/version : connect ECONNREFUSED 127.0.0.1:9229

I tried the troubleshooting on that from the readme:

http://localhost:2015/json/list

Does't resolve/return anything.

Here is the full launch.json


{
    "version": "0.2.0",
    "configurations": [

        {
            "name": "Attach to Edge",
            "port": 9229,
            "request": "attach",
            "type": "edge",
            "webRoot": "${workspaceFolder}",
            "useWebView": "advanced",
            "runtimeExecutable": "C:\\Program Files\\Microsoft Office\\root\\Office16\\Excel.exe",
            "trace": true
        },
        {
            "name": "Attach to Node Functions",
            "type": "node",
            "request": "attach",
            "port": 9229,
            "preLaunchTask": "func: host start"
        },
    ]
}
janmechtel commented 3 years ago

Using Process explorer I found that msedgewebview2 is started with port 9229.

I'm unsure if that's a parameter passed by my launch.json where node has port 9229 or, whether that's the port that edge/webview is providing for debugging.

image

janmechtel commented 3 years ago

http://localhost:9229/json/list returns something + Once I changed to launch.json in a separate project folder and used the port 9229, it seems to connect.

Now I'll have to make it use a breakpoint despite the code being in the other instance of code?

janmechtel commented 3 years ago

So the debugger is attaching now and i can read the debugger log via debug console if I open a separate folder with a launch.json like this:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Attach to Edge",
            "port": 9229,
            "request": "attach",
            "type": "edge",
            "webRoot": "${workspaceFolder}",
            "useWebView": "advanced",
            "runtimeExecutable": "C:\\Program Files\\Microsoft Office\\root\\Office16\\Excel.exe",
            "trace": true,
        }
    ]
}