-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
[REQUIRED] Environment info
firebase-tools:
13.7.0
Platform:
macOS
Sonoma 14.4.1
[REQUIRED] Test case
Right after upgrading to firebase-tools v13.7.0, the emulators started showing the error Trying to construct a python runtime delegate for runtime nodejs20
on start. I'm testing a function on Python 3.12, and I noticed it works when I add "runtime": "python312"
on firebase.json as per the documentation.
But this was never required before.
[REQUIRED] Steps to reproduce
- Create a blank function from scratch with
firebase init
, choosing "Functions" and "Emulators" as features and Python as language. Using an existing project or a new one is irrelevant, but everything else can be left as default in the rest of the process; - Runing
firebase emulators:start
after firebase finished creating the function will give the aforementioned error message; - You have to manually add the
"runtime": "python312"
on firebase.json; - Run
firebase emulators:start
again and then it will load your function correctly.
Here are some evidences of the fail case without the runtime info on firebase.json, and the success case after I added it:
No runtime on firebase.json (out of the box)
With runtime on firebase.json (manually added)
[REQUIRED] Expected behavior
I noticed the runtime validation was just introduced in this line from this commit, but maybe it would be reasonable if the runtime config could be either automatically inferred from firebase init
when we select the function language, or at least prompted to be selected by ourselves from the list of supported runtimes.
In any case, not everybody is expected to know right away that they have to manually add this information on firebase.json, let alone find a Stackoverflow answer for a newly created error message.
[REQUIRED] Actual behavior
Running firebase:emulators start --debug
gives the following log at the end:
i ui: Emulator UI logging to ui-debug.log {"metadata":{"emulator":{"name":"ui"},"message":"Emulator UI logging to \u001b[1mui-debug.log\u001b[22m"}}
[2024-04-05T04:27:26.600Z] Web / API server started at 127.0.0.1:4000
{"metadata":{"emulator":{"name":"ui"},"message":"Web / API server started at 127.0.0.1:4000\n"}}
[2024-04-05T04:27:26.600Z] Web / API server started at ::1:4000
{"metadata":{"emulator":{"name":"ui"},"message":"Web / API server started at ::1:4000\n"}}
i functions: Watching "/Users/xxxxx/test-function/functions" for Cloud Functions... {"metadata":{"emulator":{"name":"functions"},"message":"Watching \"/Users/xxxxx/test-function/functions\" for Cloud Functions..."}}
[2024-04-05T04:27:26.785Z] Customer code is not Node
⬢ functions: Failed to load function definition from source: FirebaseError: Internal error. Trying to construct a python runtime delegate for runtime nodejs20 {"metadata":{"emulator":{"name":"functions"},"message":"Failed to load function definition from source: FirebaseError: Internal error. Trying to construct a python runtime delegate for runtime nodejs20"}}