[EASY!] firebase emulator:start (in debug mode)
See original GitHub issueBefore we could debug firebase functions in a local machine by running emulator and attaching a debugger using (@google-cloud/functions-emulator) more info at https://cloud.google.com/functions/docs/emulator
For example Debugging with the Node.js Emulator. You can debug your functions running in the Node.js Emulator using either the standard Node.js Debugger or the V8 Inspector integration. To debug using the standard Node.js Debugger, run the following command:
functions debug helloWorld
since The Cloud Functions Emulator has been deprecated
Now I use firebase emulators:start --only functions (more info https://firebase.google.com/docs/functions/local-emulator)
I can run my functions locally but can not attach debugger like I used to do. And seems there are no docs on how to attach debugger for functions served by command “firebase emulators:start”
My question how we can attach a debugger to set breakpoints like here https://github.com/googlearchive/cloud-functions-emulator/wiki/Debugging-with-Visual-Studio-Code
For example
firebase --debug emulators:start --only functions
and in my vscode attach to port/process and set breakpoints
Please submit feature requests through our support page.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:13
- Comments:30 (10 by maintainers)
Solved: on how to debug firebase functions in emulator (without any dependencies like
@google-cloud/functions-emulator
)✅ no need for external libs (
@google-cloud/functions-emulator
) pure firebase functions ✅. hot reload no code changefirebase init
"debug": "tsc -w | firebase emulators:start --inspect-functions",
npm run debug
Debug: Attach to Node Process
here are screenshot steps https://imgur.com/a/LUSW8NF
@samtstern question, the known issue you are pointing to is not very releated. This issue demands some documentation on how to acctually do the debugging, because now since firebase emulators is the go to runner of a functions setup with emulators, there should be some way to run an attached process to the running node code.
The attached issue points to some issue after it seems he has gotten it to work.
But why is it not a clear way to just open a debugger inspect port?