Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to start firebase serve with --inspect-brk as we did in node?

Firebase serve command helps a lot. But I just wondering is it possible to start in --inspect-brk mode so that I can try to debug into the code locally? If not, how you debug firebase functions? console.log only?

like image 507
user3423762 Avatar asked Jul 21 '17 04:07

user3423762


1 Answers

While the Firebase CLI tools are built with node.js, the firebase serve command does currently not allow passing arguments for node.

When developing non-trivial Cloud Functions for Firebase, I often put the majority of my code in a separate file (so not in index.js). So I could then also run that file with node ocr.js --inspect-brk. For more on this approach, see my answer here: how to test Cloud Functions for Firebase locally on pc

like image 191
Frank van Puffelen Avatar answered Oct 12 '22 12:10

Frank van Puffelen