这是indexloc提供的服务,不要输入任何密码
Skip to content

Version 13.7.0 now requires manually adding "runtime" configuration in firebase.json #6965

@vitoras

Description

@vitoras

[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

  1. 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;
  2. Runing firebase emulators:start after firebase finished creating the function will give the aforementioned error message;
  3. You have to manually add the "runtime": "python312" on firebase.json;
  4. 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)

Captura de Tela 2024-04-05 às 01 39 30

With runtime on firebase.json (manually added)

Captura de Tela 2024-04-05 às 01 41 25

[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"}}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions