You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/spfx/debug-in-vscode.md
+76-8Lines changed: 76 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -20,12 +20,16 @@ You can also see the required steps to enable debugging in Visual Studio Code in
20
20
21
21
## Prerequisites
22
22
23
-
The easiest way to configure Visual Studio Code to debug SharePoint Framework solutions is by using Google Chrome and the Debugger for Chrome Visual Studio Code extension. Starting with the SharePoint Framework Yeoman generator version 1.3.4, the default project (web parts and extensions) templates come set up with the prerequisites and prompt for the required Visual Studio Code extensions to install. In this case, it prompts to install Debugger for Chrome Visual Studio Code extension.
23
+
The easiest way to configure Visual Studio Code to debug SharePoint Framework solutions is by using the [Debugger for Chrome](https://marketplace.visualstudio.com/items?itemName=msjsdiag.debugger-for-chrome) or [Debugger for Edge](https://marketplace.visualstudio.com/items?itemName=msjsdiag.debugger-for-edge) Visual Studio Code extensions.
24
+
25
+
Starting with the SharePoint Framework Yeoman generator version 1.3.4, the default project (web parts and extensions) templates come set up with the prerequisites and prompt for the required Visual Studio Code extensions to install. In this case, it prompts to install Debugger for Chrome Visual Studio Code extension.
24
26
25
27
You also need the Google Chrome browser. [Download and install the latest version of Google Chrome](https://www.google.com/chrome/browser/desktop/index.html).
26
28
27
29
If you are using a version of SharePoint Framework Yeoman generator that is older than version 1.3.4, you can [install the Chrome debugger extension for Visual Studio Code from the Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=msjsdiag.debugger-for-chrome).
28
30
31
+
In case you want to debug your projects with Microsoft Edge, you need to [install the Debugger for Edge extension for Visual Studio Code from the Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=msjsdiag.debugger-for-edge) and follow the steps in [Debugging with Microsoft Edge or older projects](#debugging-with-microsoft-edge-or-older-projects).
32
+
29
33
## Debug configurations
30
34
31
35
You can locate the debug configurations in the launch.json file under the Visual Studio Code workspace folder:
@@ -118,9 +122,12 @@ When building SharePoint Framework solutions, you will be doing such tests regul
118
122
119
123

120
124
121
-
## For older projects
125
+
## Debugging with Microsoft Edge or older projects
122
126
123
-
If you are using an older version of SharePoint Framework Yeoman generator, follow these steps to create the launch.json file manually.
127
+
If you are using an older version of SharePoint Framework Yeoman generator or want to debug with Microsoft Edge, follow these steps to create the launch.json file manually.
128
+
129
+
> [!NOTE]
130
+
> In order for you to debug with Microsoft Edge, you will have to install the **Windows 10 April 2018 Update** which includes the Microsoft Edge DevTools Protocol.
124
131
125
132
### Create debug configuration for local workbench
126
133
@@ -132,11 +139,36 @@ If you are using an older version of SharePoint Framework Yeoman generator, foll
132
139
133
140

134
141
135
-
3. In the list of debug environments, select**Chrome**.
142
+
3. In the list of debug environments, select**Edge** or **Chrome**.
143
+
144
+

145
+
146
+
4. For **Edge**, replace the contents of the generated **launch.json** file with:

169
+
This configuration uses the **Edge** debugger provided with the **Debugger forEdge** extension. It points to the URL of the local workbench as the starting point. What is essentialindebugging TypeScript code is the configuration of source maps that the debugger uses to map the JavaScript running in the browser to the original TypeScript code.
138
170
139
-
4. Replace the contents of the generated **launch.json** file with:
171
+
5. For **Chrome**, replace the contents of the generated **launch.json** file with:
140
172
141
173
```json
142
174
{
@@ -166,9 +198,45 @@ If you are using an older version of SharePoint Framework Yeoman generator, foll
166
198
167
199
### Create debug configuration for hosted workbench
168
200
169
-
1. In Visual Studio Code, open the **./.vscode/launch.json** file.
201
+
1. In Visual Studio Code, open the **./.vscode/launch.json** file.
202
+
203
+
2. For **Edge**, copy the existing debug configuration and use the URL of the hosted workbench:
0 commit comments