Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

using node --inspect to attach Firebase emulated functions to browser DevTools

I'm attempting to use node --inspect to attach my index.js Firebase functions to chrome devtools for a richer debugging experience than the terminal logs offer.

So far I've met with no success; here's what I've tried:

  1. simply running either firebase serve and firebase emulators:start (but Chrome devtools does not seem to detect these)

  2. running node --inspect against functions/index.js, which serves it on localhost:9229, but not in the context of the emulator, which I need for the other services (hosting, firestore).

  3. reading the node docs and this SO post: Can't debug node.js using Chrome DevTools

I'm not sure whether

  • (a) I'm missing something basic (highly likely),
  • (b) it isn't possible to attach the functions emulator to browser devtools, or
  • (c) it's possible, but bugged or not implemented (in which case I'll open a bug/feature request with firebase-tools).

Any direction appreciated.

like image 310
ultraGentle Avatar asked Sep 03 '26 00:09

ultraGentle


1 Answers

This was just added in version 7.11.0 of the Firebase CLI (see release notes). You need to run:

firebase emulators:start --inspect-functions
like image 85
Michael Bleigh Avatar answered Sep 04 '26 15:09

Michael Bleigh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!