OfficeDev / vscode-debugger-extension-for-office-addins

VS Code extension to allow for debugging Office Add-ins in VS Code
19 stars 9 forks source link

Debbuger doesn't stop at breakepoints #31

Open jackdawHome opened 2 years ago

jackdawHome commented 2 years ago

I'm trying to debug an Outlook Add-in in a desktop mode using settings in launch.json: { "name": "Outlook Desktop (Edge Chromium)", "type": "pwa-msedge", "request": "attach", "useWebView": true, "port": 9229, "timeout": 600000, "webRoot": "${workspaceRoot}", "preLaunchTask": "Debug: Outlook Desktop", "postDebugTask": "Stop Debug",
}

The output on the terminal looks like:

Executing task: npm run "start:desktop -- --app outlook" <

email-encryption-o365-add-on@0.0.1 start:desktop C:\Users\username\VSProjects\EmailO365AddOn office-addin-debugging start manifest.xml desktop "--app" "outlook"

Debugging is being started... App type: desktop Enabled debugging for add-in 4acdb132-1567-4758-b88b-3b398147af35. Starting the dev server... (webpack-dev-server --mode development) The dev server is running on port 3000. Process id: 25948 Sideloading the Office Add-in... Debugging started.

I can open my add-in in Outlook, but all breakpoints are ignored. How can I make them work?

I added "trace": true and got a log:

{ "tag":"runtime.launch", "timestamp":1642629494741, "message":"Error looking up /json/version", "metadata":{ "ok":false, "body":"connect ECONNREFUSED 127.0.0.1:9229", "statusCode":503, "error":{ "message":"Unexpected 503 response from http://localhost:9229/json/version: connect ECONNREFUSED 127.0.0.1:9229", "stack":"Error: Unexpected 503 response from http://localhost:9229/json/version: connect ECONNREFUSED 127.0.0.1:9229 \n\tat b.fetchHttp (c:\Users\username\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\ms-vscode.js-debug\src\extension.js:2:1146792) \n\tat runMicrotasks ()\n\tat processTicksAndRejections (internal/process/task_queues.js:93:5) \n\tat async b.fetchJson (c:\Users\username\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\ms-vscode.js-debug\src\extension.js:2:1145926) \n\tat async Promise.all (index 0)\n\tat async l (c:\Users\username\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\ms-vscode.js-debug\src\extension.js:2:1397969) \n\tat async Object.retryGetBrowserEndpoint (c:\Users\username\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\ms-vscode.js-debug\src\extension.js:2:1398771) \n\tat async Object.t.attach (c:\Users\username\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\ms-vscode.js-debug\src\extension.js:2:1386357) \n\tat async S.acquireConnectionInner (c:\Users\username\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\ms-vscode.js-debug\src\extension.js:2:1355246) \n\tat async S.acquireConnectionForBrowser (c:\Users\username\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\ms-vscode.js-debug\src\extension.js:2:1354873) \n\tat async S.attemptToAttach (c:\Users\username\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\ms-vscode.js-debug\src\extension.js:2:1353260) \n\tat async S.launch (c:\Users\username\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\ms-vscode.js-debug\src\extension.js:2:1352785) \n\tat async t.Binder.captureLaunch (c:\Users\username\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\ms-vscode.js-debug\src\extension.js:2:1230057) \n\tat async t.Binder._launch (c:\Users\username\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\ms-vscode.js-debug\src\extension.js:2:1229602) \n\tat async Promise.all (index 10)\n\tat async t.Binder._boot (c:\Users\username\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\ms-vscode.js-debug\src\extension.js:2:1228654) \n\tat async t.default._onMessage (c:\Users\username\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\ms-vscode.js-debug\src\extension.js:2:1321495)" } }, "level":0 } ...... {"tag":"runtime.launch","timestamp":1642701096269,"message":"Launch returned error", "metadata":{"error": {"message": "Cannot connect to the target at localhost:9229: Could not connect to debug target at http://localhost:9229: Could not find any debuggable target", "stack":"Error: Cannot connect to the target at localhost:9229: Could not connect to debug target at http://localhost:9229: Could not find any debuggable target \n\tat S.acquireConnectionForBrowser (c:\Users\username\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\ms-vscode.js-debug\src\extension.js:2:1354958) \n\tat runMicrotasks ()\n\tat processTicksAndRejections (internal/process/task_queues.js:93:5) \n\tat async S.attemptToAttach (c:\Users\username\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\ms-vscode.js-debug\src\extension.js:2:1353260) \n\tat async S.launch (c:\Users\username\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\ms-vscode.js-debug\src\extension.js:2:1352785) \n\tat async t.Binder.captureLaunch (c:\Users\username\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\ms-vscode.js-debug\src\extension.js:2:1230057) \n\tat async t.Binder._launch (c:\Users\username\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\ms-vscode.js-debug\src\extension.js:2:1229602) \n\tat async Promise.all (index 10) \n\tat async t.Binder._boot (c:\Users\username\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\ms-vscode.js-debug\src\extension.js:2:1228654) \n\tat async t.default._onMessage (c:\Users\username\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\ms-vscode.js-debug\src\extension.js:2:1321495)"}, "wasCancelled":true,"name":"S"},"level":2}

millerds commented 2 years ago

Can you tell us the install type (365 vs. boxed) and version of Office you have installed as well as what OS you are running on? Also can you look at your list of installed programs to see if webview2 is installed?

jackdawHome commented 2 years ago

I was able to debug my code after I installed webview2 and attached "pwa-msedge" Outlook Desktop (Edge Chromium) debugger. Is it possible to switch webview to edge(HTML) using npx office-addin-dev-settings webview .\manifest.xml edge-legacy? My environment is: node v14.18.3 32-bit Office 365 Version : 18.2110.13110.0 Microsoft® Outlook® 2019 MSO (Version 2110 Build 16.0.14527.20234) 32-bit Windows 10 Pro version is 21H2, OS build 19044.1469 I was trying to change webview and run Outlook Desktop (Edge Legacy) debugger { "name": "Outlook Desktop (Edge Legacy)", "type": "office-addin", "request": "attach", "url": "https://localhost:3000/read.html?_host_Info=Outlook$Win32$16.01$en-US$$$$0", "port": 9222, "timeout": 600000, "webRoot": "${workspaceFolder}", "preLaunchTask": "Debug: Outlook Desktop", "postDebugTask": "Stop Debug" } I got the error message: [vscode-debugger-extention-for-office-addins] Error processing "attach": connect ECONNREFUSED 127.0.0.1:9222

millerds commented 2 years ago

It appears that something about debugging environment has changed such that the adapter isn't able to run. We're currently investigating this issue to see if there is something simple we can do about it.