2017年的简单示例如何使用vscode

时间:2017-06-27 10:21:04

标签: angular debugging typescript visual-studio-code

我使用Vscode,我想修复我的应用程序中的一个大问题。解决这个问题的唯一原因是调试我的代码

我从StackOverflow中找到这个代码如何在vscode中调试角度4但是不工作是不调试任何东西enter 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

0 个答案:

没有答案