josiahpeters / vscode-angular-starter

3 stars 2 forks source link

Visual Studio Code Debugging doesn't work with Launch.json config settings #2

Open josiahpeters opened 8 years ago

josiahpeters commented 8 years ago

Looks like launch.json launches the lite-server but debugging doesn't work.

From @myusrn https://github.com/johnpapa/lite-server/issues/28#issuecomment-193485894

i tested adding that to my vscode launch.json [ https://github.com/myusrn/vscwithng2/blob/master/.vscode/launch.json ] and it did allow me to successfully launch lite-server hosted instance of ng2 app from vscode ide debug UI. note that that I was in the process of updating my vscode authoring enabled ng2 tutorial based sources to new ng2.0.0-beta.8 based package and associated dependencies one of which was lite-server moving to ^2.1.0 version. It appears you now have to create and us a bs-config.json file to control lite-server port number.

i wasn't able to get vscode debug launched instance of lite-server hosted ng2 app to stop on soft break points and likewise with attach option. wondering if there is some setting beyond tsconfig.json | "sourceMap": true and .vscode/launch.json | "sourceMaps": true that one needs to set to make that work

myusrn commented 8 years ago

Yes that's the what happened for me as well with your settings in place.

I posted vscode node app debugging extensions issues https://github.com/Microsoft/vscode-node-debug/issues/55 but haven't seen a response.

I also tested launch settings that tried coming at this from the perspective of using "npm run lite" command to kick off the lite server and then having vscode hook up debugging experience using chrome debugging story with launch.json "Launch localhost with sourcemaps" entry but that needs some tweaks it seems as well to get it working for soft break points and with typescript source maps view.

josiahpeters commented 8 years ago

I came across your issue while Googling for an answer to the problem. I thought I had solved it by integrating something else I came across, but I never actually tried dropping a breakpoint to see if debugging worked. I will update this task if I come across a solution.

Laureian commented 8 years ago

Did you founded solution for this problem?

dhruvb14 commented 8 years ago

Bump?

arkoak commented 7 years ago

Im able to debug it without issue. The sequence is:

  1. add "sourceMaps": true, to the 'Debug Chrome' section so your ts files can have breakpoints
  2. make sure you have the chrome debug extension installed
  3. start chrome with this option : --remote-debugging-port=9222
  4. make sure that there is no instance of your app open in chrome and then launch 'debug chrome' dropdown, this will launch the app in the same chrome window and will connect to 9222. and debugging starts with breakpoints enabled.