-
Notifications
You must be signed in to change notification settings - Fork 959
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Debuggers (Webstorm/VSCode) not attaching to emulators on versions >10.2.0 #4166
Comments
I performed the exact same steps on my Mac (Big Sur 11.4) with the exact same results. Same "blank" project, running emulators with --inspect-functions on 9229 and connecting to localhost but Webstorm (2021.3) debugger could not connect. firebase-tools: 10.2.0 |
After some experimenting, the issue has been found that Temporary SolutionRevert to Don't forget to do a global uninstall: npm uninstall -g firebase-tools then install previous version with: npm i -g [email protected] You should be all set! |
Having the same issue. Confirmed that the issue goes away after downgrading from 10.2 to 10.1.5 We also see a message when debugging is working:
But in the newer version we do not. |
I have also had the same thing after upgrading to 10.2.0. Couldn't get VS Code Debugger to attach, the VS Code log stated
Did a global uninstall of firebase-tools, the reinstalled 10.1.5. Thanks for the help with this, took me a while to find the solution, but hopefully a fix will be applied soon. |
Exactly the same issue + this ticket #4189 is a related issue. I was trying to understand the problem for 3 days, glad I found that its not my setup :D |
…th --inspect-functions flag (#4232) In #4149, we made large refactor of the Functions Runtime. Namely: 1) We no longer relied on Functions Runtime to parse triggers. Instead, we use [`RuntimeDelegate`](https://github.com/firebase/firebase-tools/blob/2a56d9520241ab9897a59aac22c9fd016251a7cd/src/deploy/functions/runtimes/index.ts#L114), the same procedure used to parse trigger in `firebase deploy` command. 2) Each process running the Functions Runtime was bound to a specific trigger. Unfortunately, this change broke support for `--inspect-function` where users can attach Node Debugger to step through their function when triggered. The debugging experience supported w/ `--inspect-function` relies on the fact that a single process executes all function triggers. This is drastically different to how functions run in Production environment, but it is a very useful feature that makes it easy to step through all functions in a single debug session. I wasn't aware of the debugging capabilities when making the refactor. Unfortunately, the debug feature cuts across a strong assumption I've made for the future of Functions Emulator. This is a rather hasty rollback - I'm going to have to think more deeply about how we want the evolve this feature. Fixes #4189, #4166
Hi folks. The patch for this issue was released today in firebase-tools v10.2.2. Please give it a spin and let us know if things are working expected. |
I'm filling this bug report more as an issue rather than a bug. The reason for it being a bug report is I've attempted debugging on multiple OS's on my PC (Windows, Ubuntu) and a Mac, none of which allow the debugger to attach. I thus resolved to start from scratch and work my way up to finding the problem. This isn't working out as even the simplest firebase project can't be debugged. This is after following these steps to remove Node from my Windows install to the letter, but no success.
Environment info
node: v16.13.2
npm: 8.1.2
IDE: Webstorm 2021.1.1
alt IDE: VSCode 1.64.2 (latest atm)
firebase-tools: 10.2.0
Platform: Windows 10 x64
Test case
Source can be found here. This is (at the time of writing) the simplest firebase project that can be created (see steps to reproduce).
There are 4 core files:
File: package.json
the important firebase.json:
Steps to reproduce
Create folder i.e. test-project-emulator
Create new firebase project (assume logged into firebase), specify javascript & functions feature (minimalist example) & install dependencies
i.e.
firebase init
Install functions emulator, leave all as default and install emulator (see console output*)
i.e.
firebase init emulators
Launch functions emulator
i.e.
firebase emulators:start
launch IDE and attempt to attach
IDE Debugging:
Expected behavior
Allow Webstorm/VSCode to attach to localhost:9229 and start debugging (e.g. Webstorm active debug session image)
Actual behavior
Cannot connect to debugger
Additional Information
I can navigate to localhost:4000 and see the functions emulator running: image
Listening ports:
netstat -ab | grep -e "9229" -e "4000" -e "4400" -e "8080"
TCP/9229 isn't listening, however emulator is running.
I was receiving this issue Error: TIMEOUT: Port 8080 on localhost was not active within 60000ms while using Node 17.5 (I downgraded to 16.13.2 using nvm-windows for sake of the Firebase 12/14/16 node requirements). This issue seemed to have gone away after removing node, cleared cache and downgraded to 16.*. Further, as suggested the trick to run the emulator directly resolved the hanging problem (not sure if this is related or a symptom)
Manually specifying hosts (network adapter IP or source address 0.0.0.0) had no effect on allowing the debugger to connect:
"functions": {
"port": 5001,
"host": "0.0.0.0"
},
Complete log output of all actions
The text was updated successfully, but these errors were encountered: