You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looking at the related old git issues I thought that problem was fixed in node v10 but it's not! at least in my case.
I want to debug firebase functions locally in VSCode (breakpoints) but whenever I hit the debugger button VSCode gives me this warning and then halt debugging immediately:
C:\Program Files\nodejs\node.exe --inspect-brk=46655 functions\lib\index.js
Debugger listening on ws://127.0.0.1:46655/c8545176-06c0-4b95-80ec-bcba4ca9d90e
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
Warning, FIREBASE_CONFIG and GCLOUD_PROJECT environment variables are missing. Initializing firebase-admin will fail
setup.js:53
I followed the guide https://firebase.google.com/docs/functions/local-shell to set GOOGLE_APPLICATION_CREDENTIALS but that seem to have no affect. This config works for firebase functions:shell but not for vscode debugger.
I also initialized the admin object in ts/js code but debugger gave the same issue:
I'm not that familiar with the VS Code debugger but it looks like it's just running the code directly without wrapping it in the Firebase CLI commands that typically provide those environment variables. You should be able to mimic the CLI behavior by setting up your debugger to launch with FIREBASE_CONFIG env variable set to a JSON serialization of your Firebase Admin SDK config (see https://firebase.google.com/docs/projects/api/reference/rest/v1beta1/projects/getAdminSdkConfig for what should go in there).
Looking at the related old git issues I thought that problem was fixed in node v10 but it's not! at least in my case.
I want to debug firebase functions locally in VSCode (breakpoints) but whenever I hit the debugger button VSCode gives me this warning and then halt debugging immediately:
I followed the guide https://firebase.google.com/docs/functions/local-shell to set GOOGLE_APPLICATION_CREDENTIALS but that seem to have no affect. This config works for
firebase functions:shell
but not for vscode debugger.I also initialized the admin object in ts/js code but debugger gave the same issue:
VSCode launch.json
package.json
firebase.json:
Platform: Windows 10
Project: Firebase web app with Typescript functions
firebase versions are mentioned in above json.
Do let me know if further details are required.
The text was updated successfully, but these errors were encountered: