Skip to content

How would you debug in vscode? #92

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kuncevic opened this issue May 10, 2016 · 6 comments
Closed

How would you debug in vscode? #92

kuncevic opened this issue May 10, 2016 · 6 comments

Comments

@kuncevic
Copy link

kuncevic commented May 10, 2016

Just wondering what is the best approach to debug using vscode?

Should I just run npm run build #93 and debug dist by running live-server or something or there is a better way?

@Foxandxss
Copy link
Member

What you mean with debug in here? Because build will create your production build and with debug I think about development.

@kuncevic
Copy link
Author

kuncevic commented May 10, 2016

Ah OK my bad so how would you debug anyway using vscode? any other best approach? I just wasn't being able to produce build anyway to check my unlucky guess due to #93

@Foxandxss
Copy link
Member

Wrong person to ask, I survive with console.logs and that is definitely not the way to go :/

Better if you ask in SO or other sites, because I cannot be of any help.

@kuncevic
Copy link
Author

kuncevic commented May 10, 2016

Get bored by console.log..

Actually I was trying to use this thing https://github.com/Microsoft/vscode-chrome-debug but no luck. I think because of webpack. Haven't dig much in to that after all.

Then looked in to this one http://schempy.com/2016/01/19/angular2_webpack_typescript/ but not working for me when trying to set breakpoints in chrome as mentioned in article.

UPDATE. Actually the second option is working. I was doing the full page refresh at first which is didn't triggered my break points in chrome dev tools for some reason. But after app is loaded and I tried to click on my route component I set breakpoints on - in such case all my ts breakpoints was getting hit.

Navigate http://localhost:8080 in a browser (I use chrome). Once the page is loaded open devtools and click on the Sources tab. Drill down on the list item labeled webpack on the left-side. You’ll notice there are the original typescript files! Click on one and check for yourself. You can set breakpoints and start digging in! Here is what your screen should look like:

image

image

@Foxandxss
Copy link
Member

Will take a peek at both and if I get something interesting, I could update the README here.

@kuncevic
Copy link
Author

kuncevic commented May 10, 2016

Cool. Checkout my updated update above :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants