Skip to content

Commit ec608c0

Browse files
maxwondercornJen Weber
authored andcommitted
Debug node code instructions (#35)
* debug node code instructions * updated instructions based on Hemingway * simplifed write up, alternate Chrome options * combinded node-debug with code editor integrations * removed recomended for NiM, opion - not required
1 parent b549936 commit ec608c0

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

guides/pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
url: 'index'
6262
- title: 'Windows support'
6363
url: 'windows'
64-
- title: 'Code Editor Integrations'
64+
- title: 'Developer Tools'
6565
url: 'dev-tools'
6666
- title: 'Common issues'
6767
url: 'common-issues'

guides/reference/dev-tools.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
<!-- Copy over code editor content -->
2+
<!-- This intro paragraph needs improvement -->
3+
4+
This section provides information on integrating Ember into various code editors and how to debug ember-cli node code.
5+
6+
## Code Editor Integrations
27

38
### Visual Studio Code
49
If you are using [VSCode](https://code.visualstudio.com/) with `ember-cli`, there's an [official
@@ -146,3 +151,27 @@ Some useful Vim plugins for working with Ember.js:
146151
147152
- [ember_tools](https://github.com/AndrewRadev/ember_tools.vim) - Provides various tools for navigation and code reformatting, similar to rails.vim for Rails.
148153
- [projectionist](https://github.com/tpope/vim-projectionist) - Powerful project navigation, provided you write your own code projections. Here's [an example](https://gist.github.com/AndrewRadev/3524ee46bca8ab349329)
154+
155+
## Debugging Node Code
156+
157+
Node's debugger with Chrome's DevTools can debug node code in an addon or app. For example, debugging Broccoli errors in an addon's `index.js`.
158+
159+
To use the node debugger, open Chrome DevTools with `chrome://inspect` or use the [Node.js - inspection manager (NiM)](https://chrome.google.com/webstore/detail/nodejs-v8-inspector-manag/gnhhdgbaldcilmgcpfddgdbkhjohddkj) from the Chrome web store. See Node [documentation](https://nodejs.org/en/docs/guides/debugging-getting-started/#chrome-devtools-55) for details.
160+
161+
To debug, place a `debugger` statement where the code should break. Then serve the application using
162+
163+
```bash
164+
node --inspect node_modules/ember-cli/bin/ember serve
165+
```
166+
167+
You will see a message similar to this in the console.
168+
169+
170+
```bash
171+
Debugger listening on ws://127.0.0.1:9229/9c664016-bcfa-444b-b7fe-57d91a0d6e8f
172+
For help see https://nodejs.org/en/docs/inspector
173+
Debugger attached.
174+
```
175+
If you used `chrome://inspect`, click on the `inspect` link to launch DevTools. NiM will automatically open DevTools.
176+
177+
Stop Ember serve using `Ctrl-C` and then close the DevTools tab.

0 commit comments

Comments
 (0)