5 ms·
Demo showing how to debug node code using Chrome DevTools at 26:18[1]. Very cool if you don't already have a full blown IDE with debugging built in. Or even if
by talawahdotnet 9y ago
Demo showing how to debug node code using Chrome DevTools at 26:18[1]. Very cool if you don't already have a full blown IDE with debugging built in. Or even if you just want to inspect some random node library/code on the fly.
1. https://youtu.be/EdFDJANJJLs?t=26m18s https://youtu.be/EdFDJANJJLs?t=26m18s
- gear54rus 9y agoHave you by chance found how to do that with babel-node? It seems that after introducing a built-in chrome protocol debugger node-inspector was abandoned and now I can't figure out how to use the built-in debugger with babel-node.
- paulirish 9y agoI just tested and it looks like `babel-node --inspect` works fine. However `--inspect-brk` does require this small PR: https://github.com/babel/babel/pull/5785 https://github.com/babel/babel/pull/5785 And FWIW, my written guide here captures the basics that Seth covered in the video: https://medium.com/@paul_irish/debugging-node-js-nightlies-with-chrome-devtools-7c4a1b95ae27 https://medium.com/@paul_irish/debugging-node-js-nightlies-w...
- afarrell 9y agoI wish node also has a full-featured server-side debugger that worked in the terminal. When I'm writing server-side code and popping `debugger;` into my unit test, I really don't want to go to open up a chrone window and use my mouse to fiddle with the sizes of the panes to make debugging in chrome work. It looks like this protocol could eliminate the problem of waiting for the connection to come through (it drops a lot of the time when you do it within unit tests), which is great. If I wanted to get started adding this to node.js, does anyone have any suggestions for where I would start? Presumably by first getting a solid mental model of V8's internals, but has anyone else worked on debuggers that could give me some pointers?
- swah 9y agoAny IDEs you think are better than this?