1

I use Vscode and I want to fix one big problem I have in my app. the only reason to fix that is to debug my code

I find this code from the StackOverflow how to debug angular 4 in vscode but is not working is don't debug anythingenter image description here

launch.json

    {
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Launch Chrome against localhost, with sourcemaps",
      "type": "chrome",
      "request": "launch",
      "url": "http://localhost:4200/all-products",
      "sourceMaps": true,
      "diagnosticLogging": true,
      "webRoot": "${workspaceRoot}",
      "userDataDir": "${workspaceRoot}/.vscode/chrome"
    },
    {
      "name": "Attach to Chrome, with sourcemaps",
      "type": "chrome",
      "request": "attach",
      "port": 9222,
      "sourceMaps": true,
      "diagnosticLogging": true,
      "webRoot": "${workspaceRoot}"
    }
  ]
}

DEBUG CONSOLE

Error processing "restart": TypeError: Cannot read property 'Page' of undefined
at ChromeDebugAdapter.restart (C:\Users\Developer.vscode\extensions\msjsdiag.debugger-for-chrome-3.1.5\out\bundle.js:304:27)
at Object.dispatchRequest (C:\Users\Developer.vscode\extensions\msjsdiag.debugger-for-chrome-3.1.5\node_modules\vscode-chrome-debug-core\out\src\chrome\chromeDebugSession.js:75:82)
at Object.ProtocolServer._handleData (C:\Users\Developer.vscode\extensions\msjsdiag.debugger-for-chrome-3.1.5\node_modules\vscode-chrome-debug-core\node_modules\vscode-debugadapter\lib\protocol.js:104:38)
at Socket. (C:\Users\Developer.vscode\extensions\msjsdiag.debugger-for-chrome-3.1.5\node_modules\vscode-chrome-debug-core\node_modules\vscode-debugadapter\lib\protocol.js:24:60)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:176:18)
at Socket.Readable.push (_stream_readable.js:134:10)
at Pipe.onread (net.js:551:20)
Terminated: Got disconnect request
Killing Chrome process by pid: taskkill /F /T /PID 3188
  • Did you install the chrome debugger extension? – Kokodoko Jun 27 '17 at 11:35
  • Yes, i have installed months ago but never used in developing now I face a problem and I don't know where to start. if yo can sent me the basic working example in the launch.json I appreciated –  Jun 27 '17 at 13:54
  • This launch.json worked for me (copy the json from the question and then replace the configuration from the answer - dont forget to fill in your own localhost project url) https://stackoverflow.com/questions/44698146/how-to-debug-client-side-in-visual-studio-code – Kokodoko Jun 27 '17 at 14:33
  • Possible duplicate of [Angular CLI 1.7.0 and Visual Studio Code - can't set breakpoints](https://stackoverflow.com/questions/48892311/angular-cli-1-7-0-and-visual-studio-code-cant-set-breakpoints) – Liebster Kamerad Feb 26 '19 at 13:18

0 Answers0