0

I would like to use teams toolkit to debug my app locally.

Documentation mention here the I only should run F5 than launch chrome debug to roll out all the steps.

In my case doing this only create a Launch.json file and open localhost address in the browser.

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "type": "edge",
            "version": "stable",
            "request": "launch",
            "name": "Lancer Edge en utilisant localhost",
            "url": "http://localhost:8080",
            "webRoot": "${workspaceFolder}"
        }
    ]
}

But according to documentation it should open teams web app.

Am I missing a step ?

Here's also a video explaining the debug process.

infodev
  • 4,673
  • 17
  • 65
  • 138

2 Answers2

0

Is your app created by Teams Toolkit?

Only the apps created by Teams Toolkit are supported to debug locally. Follow the video you mentioned to have a try.

Kuojian Lu
  • 66
  • 1
  • I used the Teams Toolkit to generate the app , but it's a sample app not a new app . May be the sample apps don't contains tasks.json / launch.json files – infodev May 17 '22 at 11:37
  • Which sample app? Yeah, some sample does not support local debugging. You can follow README in the sample app to try the sample. – Kuojian Lu May 18 '22 at 05:39
  • I'm trying the in-meeting-app sample – infodev May 21 '22 at 15:28
0

We have created the app using Teams Toolkit and the launch.json and task.json are created.

After running the app it goes to Edge browser and teams web app is loaded. You need to change the url in configuration of launch.json file.

In your code its "http://localhost:8080" so its redirecting to it.

You need to change it to "https://teams.microsoft.com/l/app/${teamsAppId}?installAppPackage=true&webjoin=true&${account-hint}"

Refer the below launch.json code:

  {
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch Remote (Edge)",
            "type": "pwa-msedge",
            "request": "launch",
            "url": "https://teams.microsoft.com/l/app/${teamsAppId}?installAppPackage=true&webjoin=true&${account-hint}",
            "presentation": {
                "group": "remote",
                "order": 1
            }
        },
        {
            "name": "Launch Remote (Chrome)",
            "type": "pwa-chrome",
            "request": "launch",
            "url": "https://teams.microsoft.com/l/app/${teamsAppId}?installAppPackage=true&webjoin=true&${account-hint}",
            "presentation": {
                "group": "remote",
                "order": 2
            }
        },
        {
            "name": "Launch Bot (Edge)",
            "type": "pwa-msedge",
            "request": "launch",
            "url": "https://teams.microsoft.com/l/app/${localTeamsAppId}?installAppPackage=true&webjoin=true&${account-hint}",
            "cascadeTerminateToConfigurations": [
                "Attach to Bot"
            ],
            "presentation": {
                "group": "all",
                "hidden": true
            }
        },
        {
            "name": "Launch Bot (Chrome)",
            "type": "pwa-chrome",
            "request": "launch",
            "url": "https://teams.microsoft.com/l/app/${localTeamsAppId}?installAppPackage=true&webjoin=true&${account-hint}",
            "cascadeTerminateToConfigurations": [
                "Attach to Bot"
            ],
            "presentation": {
                "group": "all",
                "hidden": true
            }
        },
        {
            "name": "Attach to Bot",
            "type": "pwa-node",
            "request": "attach",
            "port": 9239,
            "restart": true,
            "presentation": {
                "group": "all",
                "hidden": true
            }
        }
    ],
    "compounds": [
        {
            "name": "Debug (Edge)",
            "configurations": [
                "Launch Bot (Edge)",
                "Attach to Bot"
            ],
            "preLaunchTask": "Pre Debug Check & Start All",
            "presentation": {
                "group": "all",
                "order": 1
            },
            "stopAll": true
        },
        {
            "name": "Debug (Chrome)",
            "configurations": [
                "Launch Bot (Chrome)",
                "Attach to Bot"
            ],
            "preLaunchTask": "Pre Debug Check & Start All",
            "presentation": {
                "group": "all",
                "order": 2
            },
            "stopAll": true
        }
    ]
}
Nivedipa-MSFT
  • 1,237
  • 1
  • 2
  • 8