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
Improve error messages when functions fails to load (#5782)
We will proactively try to identify common issues based on error messages to provide better debugging experience.
1. No `venv` directory:
```
➜ functions firebase emulators:start
i emulators: Starting emulators: functions
i functions: Watching "/Users/REDACTED/google/cf3-pyinit/functions" for Cloud Functions...
⬢ functions: Failed to load function definition from source: FirebaseError: Failed to find location of Firebase Functions SDK: Missing virtual environment at venv directory. Did you forget to run 'python3.11 -m venv venv'?
```
2. No `firebase-functions` package
```
➜ functions firebase emulators:start
i emulators: Starting emulators: functions
i functions: Watching "/Users/REDACTED/google/cf3-pyinit/functions" for Cloud Functions...
⬢ functions: Failed to load function definition from source: FirebaseError: Failed to find location of Firebase Functions SDK. Did you forget to run 'source /Users/danielylee/google/cf3-pyinit/functions/venv/bin/activate && python3.11 -m pip install -r requirements.txt'?
```
3. Runtime errors
```
➜ functions firebase emulators:start
i emulators: Starting emulators: functions
i functions: Watching "/Users/REDACTED/google/cf3-pyinit/functions" for Cloud Functions...
⚠ functions: Failed to detect functions from source FirebaseError: Failed to parse build specification.
stderr:WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
* Running on http://127.0.0.1:8081
Press CTRL+C to quit
[2023-05-02 19:29:18,285] ERROR in app: Exception on /__/functions.yaml [GET]
Traceback (most recent call last):
...
File "/Users/REDACTED/google/cf3-pyinit/functions/main.py", line 8, in <module>
foo += 1
^^^
NameError: name 'foo' is not defined
```
0 commit comments