firebase-tools: Can't debug with firebase tools 6.10.0 in vs code due to unverified breakpoints
[REQUIRED] Environment info
firebase-tools: 6.10.0
Platform:macOs, Windows
[REQUIRED] Test case
launching attach to debug from launch.json, breakpoint will result all unverified with no possibility to stop in
[REQUIRED] Steps to reproduce
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "attach",
"name": "Attach by Process ID",
"processId": "${command:PickProcess}"
}
]
}
simply run Attach by Process ID, and breakpoints will result in grey unverified.
[REQUIRED] Expected behavior
breakpoint must to remain red for stop in and debug
[REQUIRED] Actual behavior
breakpoint remain grey after debug launched
i’d like to add that i have tested debug with firebase-tools 6.3.0 and attach to process perfectly work. with 6.10.0 doesn’t.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 1
- Comments: 35 (16 by maintainers)
Version
7.11.0is now released and introduces breakpoint debugging with the command:Then you can attach the debugger to port 9229 (default)
So I’ve looked into this a bit and it seems like it’s going to be tricky. If we changed how the emulator works to solve #1353 it would also make this easier, so this is an argument in favor of changing that system.
A bit of documentation about this would be really helpful on the Firebase site tutorials. Trying to run with
$ firebase servedid not run my npm script ‘serve’Instead I needed to go into my
functionsfolder, and run npm directly with:$ npm run-script serveMy
functions/package.jsonscript forservelooks like this now:"serve": "tsc -w | firebase emulators:start --inspect-functions",This allows watching for TypeScript changes, and starting up emulation with debugging. This is super helpful when actively developing code on your local machine! Life is so much better now.@JerryGoyal
7.10.0is the current release. This will be included in the next release, so7.11.0is the likely version number.Hi @abeisgoat , sure i can, so:
now press F1 it will open the command menu and type: debug: Attach by Process ID usually is the first process. Now your bottom bar from blue should turn orange
at this point you will notice that if you put a breakpoint on:
the breakpoint doesn’t turn red but grey and it will say “unverified breakpoint” thus calling timestamp endpoint in the browser it won’t stop on the line.
instead repeat the test with firebase-tools@6.3.0 (or at least prior to 6.9.0) and it will work!
@johngboutros that’s a good feature request and I could see a few ways of achieving it:
a) Disable timeouts entirely in debug mode b) Disable the timeout counter while a breakpoint is active c) Other??
Would you mind filing a new issue to discuss?
This has been implemented and will be included in the next release.
Fantastic, thanks for the thorough and quick response, I’ll take a look at this when I get some time and report back!
Thanks @vincy261. I think @abeisgoat knows more about this. The new emulator (in versions 6.9.0 and above) runs the functions in a separate process which probably needs to expose some more information to be debuggable.