Skip to content

Commit 069bc82

Browse files
committed
edits
1 parent 47d2cb5 commit 069bc82

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

docs/javascript/debug-nodejs.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ For help with generating source maps, see [Generate source maps for debugging](#
8181
### <a name="prepare_the_browser_for_debugging"></a> Manually configure the browser for debugging
8282

8383
::: moniker range=">=vs-2022"
84-
In Visual Studio 2022, the procedure described in this section is available only in ASP.NET and ASP.NET Core applications. It is required only in uncommon scenarios where you need to customize browser settings.
84+
In Visual Studio 2022, the procedure described in this section is available only in ASP.NET and ASP.NET Core applications. It is required only in uncommon scenarios where you need to customize browser settings. In *.esproj* projects, the browser is configured for debugging by default.
8585
::: moniker-end
8686

8787
For this scenario, use either Microsoft Edge or Chrome.
@@ -123,6 +123,8 @@ For this scenario, use either Microsoft Edge or Chrome.
123123
### Attach the debugger to client-side script
124124

125125
::: moniker range=">=vs-2022"
126+
In some scenarios, you may need to attach the debugger to a running app.
127+
126128
To attach the debugger from Visual Studio and hit breakpoints in the client-side code, it needs help with identifying the correct process. Here's one way to enable it.
127129

128130
1. Make sure your app is running in the browser in debug mode, as described in the preceding section.
@@ -135,7 +137,7 @@ To attach the debugger from Visual Studio and hit breakpoints in the client-side
135137

136138
To find the specific code in a transpiled file, use **Ctrl**+**F** (**Edit** > **Find and Replace** > **Quick Find**).
137139

138-
For client-side code, to hit a breakpoint in a TypeScript file, *.vue*, or *JSX* file typically requires the use of [source maps](#generate_source_maps). A source map must be configured correctly to support debugging in Visual Studio.
140+
For client-side code, to hit a breakpoint in a TypeScript file, *.vue*, or *JSX* file typically requires the use of [source maps](https://code.visualstudio.com/docs/nodejs/nodejs-debugging#_source-maps). A source map must be configured correctly to support debugging in Visual Studio.
139141

140142
1. Choose **Debug** > **Attach to Process**.
141143

@@ -162,7 +164,7 @@ To attach the debugger from Visual Studio and hit breakpoints in the client-side
162164

163165
You may hit the breakpoint in either a transpiled `.js` file or source file, depending on your app type, which steps you followed previously, and other factors such as your browser state. Either way, you can step through code and examine variables.
164166

165-
* If you need to break into code in a TypeScript, JSX, or `.vue` source file and are unable to do it, make sure that your environment is set up correctly, as described in the [Troubleshooting](#troubleshooting_source_maps) section.
167+
* If you need to break into code in a TypeScript, JSX, or `.vue` source file and are unable to do it, make sure that your environment is set up correctly, as described in the [Source maps](https://code.visualstudio.com/docs/nodejs/nodejs-debugging#_source-maps) section of the VS Code documentation.
166168

167169
* If you need to break into code in a transpiled JavaScript file (for example, *app-bundle.js*) and are unable to do it, remove the source map file, *filename.js.map*.
168170
::: moniker-end
@@ -211,6 +213,7 @@ To attach the debugger from Visual Studio and hit breakpoints in the client-side
211213
* If you need to break into code in a transpiled JavaScript file (for example, *app-bundle.js*) and are unable to do it, remove the source map file, *filename.js.map*.
212214
::: moniker-end
213215

216+
::: moniker range="vs-2019"
214217
### <a name="troubleshooting_source_maps"></a> Troubleshooting breakpoints and source maps
215218

216219
If you need to break into code in a TypeScript or JSX source file and are unable to do it, use **Attach to Process** as described in the previous section to attach the debugger. Make sure that your environment is set up correctly:
@@ -288,6 +291,7 @@ If you add a `tsconfig.json` file to your project, Visual Studio treats the dire
288291
- **sourceRoot**: Specifies the location where the debugger should find TypeScript files instead of the source locations. Use this flag if the run-time sources need to be in a different location than the location at design-time. The location specified is embedded in the source map to direct the debugger to where the source files are located.
289292

290293
For more details about the compiler options, check the page [Compiler Options](https://www.typescriptlang.org/docs/handbook/compiler-options.html) on the TypeScript Handbook.
294+
::: moniker-end
291295

292296
::: moniker range="vs-2019"
293297
### Configure source maps using project settings (TypeScript project)

0 commit comments

Comments
 (0)