Skip to content
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

Angular CLI update for new VS Code JS debugger #313

Merged
merged 2 commits into from
Aug 5, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions Angular-CLI/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
# Chrome Debugging with Angular CLI
# Chrome/Edge Debugging with Angular CLI

by [Anthony Sneed (@tonysneed)](https://github.com/tonysneed)

This recipe shows how to use the [Debugger for Chrome](https://github.com/Microsoft/vscode-chrome-debug) extension with VS Code to debug
an application generated by the [Angular CLI](https://cli.angular.io/).
This recipe shows how to use VS Code to debug an application generated by the [Angular CLI](https://cli.angular.io/).

## Getting Started

- Make sure to have [Google Chrome](https://www.google.com/chrome) installed in its default location.

- Make sure to have version **3.1.4** or greater of the [Debugger for Chrome](https://marketplace.visualstudio.com/items?itemName=msjsdiag.debugger-for-chrome) extension installed in VS Code.
- Make sure to have [Google Chrome](https://www.google.com/chrome) or [Microsoft Edge](https://www.microsoft.com/edge) installed in its default location.

- Use [NPM](https://www.npmjs.com) to install [Angular CLI](https://cli.angular.io) version **6.0** or greater globally.

Expand Down Expand Up @@ -39,15 +36,15 @@ Then click on the gear icon to configure a launch.json file, selecting **Chrome*

![add-chrome-debug](https://user-images.githubusercontent.com/2836367/27004175-77582668-4dca-11e7-9ce8-30ef3af64a36.png)

- Replace content of the generated launch.json with the following three configurations:
- Replace content of the generated launch.json with the following three configurations (use `pwa-msedge` for MS Edge):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change to pwa-msedge/chrome isn't required, see microsoft/vscode-js-debug#1065

Copy link
Contributor Author

@rfuhrer rfuhrer Aug 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, I was just changing that based on what VS Code was telling me:
image
image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Debugger for Chrome is still needed to use type: chrome in the currently-released VS Code versions, but that will no longer be the case in 1.60.0 (which releases to stable early next month, and should arrive in Insiders today)


```json
{
"version": "0.2.0",
"configurations": [
{
"name": "ng serve",
"type": "chrome",
"type": "pwa-chrome",
"request": "launch",
"preLaunchTask": "npm: start",
"url": "http://localhost:4200/#",
Expand All @@ -62,7 +59,7 @@ Then click on the gear icon to configure a launch.json file, selecting **Chrome*
},
{
"name": "ng test",
"type": "chrome",
"type": "pwa-chrome",
"request": "launch",
"url": "http://localhost:9876/debug.html",
"webRoot": "${workspaceFolder}",
Expand Down