-1

Hi I am trying to debug the application in visual studio code but i am unable to debug, its showing me error message 'configured debug type'chrome' is not supported'.

Following is launch.json file code

{
// 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": "chrome",
        "request": "attach",
        "name": "Attach to Chrome",
        "port": 4200,
        "webRoot": "${workspaceFolder}"
    }
]
}
Vishal
  • 139
  • 1
  • 5
  • 12

2 Answers2

2

Anyone who is looking for a quick fix try this:

make sure your port number in the Launch.json settings is same as the one you get after "ng serve" command. usually it is "4200" and try to include both launch and attach settings in Launch.json.

once "ng serve" is completed and angular server started listening try to click "start debugging"

then the debugger will lauch a chrome instance on 4200 and after that you can see the break point will be bound.

Do not launch it manually by typing the link(http://localhost:4200/) in browser

1

You need to add this bellow "webRoot" in the existing configuration:

"sourceMapPathOverrides": {
    "/./*": "${webRoot}/*",
    "/src/*": "${webRoot}/*",
    "/*": "*",
    "/./~/*": "${webRoot}/node_modules/*",
  }
Oscar Velandia
  • 1,157
  • 1
  • 7
  • 9