-
Notifications
You must be signed in to change notification settings - Fork 971
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 ```
- Loading branch information
Showing
3 changed files
with
68 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters