4

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.

ultraGentle
  • 5,084
  • 1
  • 19
  • 45

1 Answers1

9

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
Michael Bleigh
  • 25,334
  • 2
  • 79
  • 85
  • Hi Michael, I get the error `error: unknown option '--inspect-functions'` when running that command. I've also made a question on here as well, I would really appreciate any help. https://stackoverflow.com/questions/60493134/error-unknown-option-inspect-functions-return-when-adding-inspect-functio – Andrew Irwin Mar 02 '20 at 16:42