microsoft / vscode-recipes

MIT License
5.86k stars 577 forks source link

I Can't Debug vue.js When "preLaunchTask" is added in launch.json #320

Open Michaelzhouisnotwhite opened 2 years ago

Michaelzhouisnotwhite commented 2 years ago

My task.json is as follows:

{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "npm run serve",
      "type": "npm",
      "script": "serve",
      "isBackground": true,
      "problemMatcher": [
        {
          "base": "$tsc-watch",
          "background": {
            "activeOnStart": true,
            "beginsPattern": "Starting development server",
            "endsPattern": "Compiled successfully"
          }
        }
      ],
      "group": {
        "kind": "build",
        "isDefault": true
      }
    }
  ]
}

My launch.json is as follows


  "version": "0.2.0",
  "configurations": [
    {
      "type": "pwa-msedge",
      "request": "launch",
      "name": "vuejs: edge",
      "url": "http://localhost:8081",
      "webRoot": "${workspaceFolder}/src",
      "breakOnLoad": true,
      "sourceMapPathOverrides": {
        "webpack:///src/*": "${webRoot}/*"
      },
      // "preLaunchTask": "npm run serve"
    },
  ]
}

When I uncomment the "preLaunchTask" value, the debugger can't start. After I remove it , it works well. I guess may be a bug happens.