4 ms·
JavaScript's remote debugging protocol is a total game changer. Highly recommend looking into it. And yes you can use it on frontend stuff if you invoke your b
by kristopolous 4y ago
JavaScript's remote debugging protocol is a total game changer. Highly recommend looking into it.
And yes you can use it on frontend stuff if you invoke your browser correctly
And yes you can use it to debug mobile through chrome's inspect feature. And yes you can proxy that to use it in your editor of choice and yes GUD with emacs is supported
And yes the "debugger" keyword correctly triggers the breakpoint through this entire pipeline. It's borderline magic
- dzhiurgis 4y agoUsed to be ndb index.js But node debugger died at some macos release and I haven’t figured anything close to it.
- hoten 4y agondb definitely stills works for me on Mac. But these days, I just use VS code. Open a special JS terminal (https://imgur.com/a/nqEFYkz https://imgur.com/a/nqEFYkz), then the debugger will auto-attach to any Node process run in that terminal.
- dzhiurgis 4y agoIIRC it was one particular aspect, maybe it playwright or other third party tool that was crashing it. Thing that's nice with ndb it's the same UI as Chrome devtools that I'm so used to. Debugging via Webstorm felt too weird (tho probably 2x more powerful). Not a VSCode user.
- cmroanirgo 4y agoRemote debugging is not new. I was doing it with vc++ back in the early 00's, & am pretty sure was there in the 90's.
- kristopolous 4y agoOf JavaScript? Really? The concept of remote debugging is just one of instrumentation, that's from the 1960s, this isn't a conceptually new thing. It's a functionally useful one
- dexwiz 4y agoThe issue with JavaScript debugging is you are often using an ad hoc pipeline of transpilers. So even if you pause at a debugger Keyword, the code may look completely different. It takes work to get source maps to work correctly.
- koshergweilo 4y agoShouldn't source maps take care of this in all but the production build
- sph 4y agoThey should. They don't always do in practice, and debugging broken and useless source maps is another pain area.
- FpUser 4y agoOne of the main reasons I always use vanilla JavaScript.
- cxr 4y agoThat's rather more an issue with "using an ad hoc pipeline of transpilers" than it is an issue "with JavaScript debugging".
- ht85 4y agoIt even works in prod: send the appropriate signal to a node process, pipe the default debug port through ssh and open your node devtools locally. This has saved me so many hours.
- deleted 4y ago[deleted]
- BiteCode_dev 4y agoIt's magic if: - you set it up correctly - your entire stack is compatible from end 2 end - there is now weird thing with map files - you don't dev using firefox It's a lot of if.