firebase / firebase-tools

The Firebase Command Line Tools
MIT License
4.01k stars 929 forks source link

Node.js 22 (nodejs22) not working for functions deployment #7247

Closed lukaselmer closed 4 months ago

lukaselmer commented 4 months ago

[REQUIRED] Environment info

firebase-tools: 13.10.2

Platform: macOS

[REQUIRED] Test case

{
  "$schema": "https://raw.githubusercontent.com/firebase/firebase-tools/master/schema/firebase-config.json",
  "functions": [
    {
      "source": ".",
      "codebase": "default",
      "runtime": "nodejs22"
    }
  ]
}

[REQUIRED] Steps to reproduce

firebase deploy --only functions

[REQUIRED] Expected behavior

Deploys nodejs22

According to https://cloud.google.com/functions/docs/release-notes#May_17_2024 and https://cloud.google.com/static/functions/docs/runtime-support#node.js , Node.js 22 should be supported

image
gcloud functions runtimes list
Suggest using `--region us-west1`
NAME: dotnet3
STAGE: DEPRECATED
ENVIRONMENTS: 1st gen, 2nd gen

NAME: dotnet6
STAGE: GA
ENVIRONMENTS: 1st gen, 2nd gen

NAME: dotnet8
STAGE: GA
ENVIRONMENTS: 2nd gen

NAME: go113
STAGE: DEPRECATED
ENVIRONMENTS: 1st gen, 2nd gen

NAME: go116
STAGE: DEPRECATED
ENVIRONMENTS: 1st gen, 2nd gen

NAME: go118
STAGE: DEPRECATED
ENVIRONMENTS: 1st gen, 2nd gen

NAME: go119
STAGE: DEPRECATED
ENVIRONMENTS: 1st gen, 2nd gen

NAME: go120
STAGE: DEPRECATED
ENVIRONMENTS: 1st gen, 2nd gen

NAME: go121
STAGE: GA
ENVIRONMENTS: 1st gen, 2nd gen

NAME: go122
STAGE: GA
ENVIRONMENTS: 2nd gen

NAME: java11
STAGE: GA
ENVIRONMENTS: 1st gen, 2nd gen

NAME: java17
STAGE: GA
ENVIRONMENTS: 1st gen, 2nd gen

NAME: java21
STAGE: GA
ENVIRONMENTS: 2nd gen

NAME: nodejs10
STAGE: DEPRECATED
ENVIRONMENTS: 1st gen

NAME: nodejs12
STAGE: DEPRECATED
ENVIRONMENTS: 1st gen, 2nd gen

NAME: nodejs14
STAGE: DEPRECATED
ENVIRONMENTS: 1st gen, 2nd gen

NAME: nodejs16
STAGE: DEPRECATED
ENVIRONMENTS: 1st gen, 2nd gen

NAME: nodejs18
STAGE: GA
ENVIRONMENTS: 1st gen, 2nd gen

NAME: nodejs20
STAGE: GA
ENVIRONMENTS: 1st gen, 2nd gen

NAME: nodejs22
STAGE: BETA
ENVIRONMENTS: 2nd gen

NAME: php74
STAGE: DEPRECATED
ENVIRONMENTS: 1st gen, 2nd gen

NAME: php81
STAGE: GA
ENVIRONMENTS: 1st gen, 2nd gen

NAME: php82
STAGE: GA
ENVIRONMENTS: 1st gen, 2nd gen

NAME: php83
STAGE: GA
ENVIRONMENTS: 2nd gen

NAME: python37
STAGE: DEPRECATED
ENVIRONMENTS: 1st gen

NAME: python38
STAGE: GA
ENVIRONMENTS: 1st gen, 2nd gen

NAME: python39
STAGE: GA
ENVIRONMENTS: 1st gen, 2nd gen

NAME: python310
STAGE: GA
ENVIRONMENTS: 1st gen, 2nd gen

NAME: python311
STAGE: GA
ENVIRONMENTS: 1st gen, 2nd gen

NAME: python312
STAGE: GA
ENVIRONMENTS: 1st gen, 2nd gen

NAME: ruby26
STAGE: DEPRECATED
ENVIRONMENTS: 1st gen, 2nd gen

NAME: ruby27
STAGE: DEPRECATED
ENVIRONMENTS: 1st gen, 2nd gen

NAME: ruby30
STAGE: DEPRECATED
ENVIRONMENTS: 1st gen, 2nd gen

NAME: ruby32
STAGE: GA
ENVIRONMENTS: 1st gen, 2nd gen

[REQUIRED] Actual behavior

Error: Functions codebase default has invalid runtime nodejs22 specified in firebase.json. Valid values are: - nodejs6
- nodejs8
- nodejs10
- nodejs12
- nodejs14
- nodejs16
- nodejs18
- nodejs20
- python310
- python311
- python312

Having trouble? Try firebase [command] --help

PS: I think that the newline is missing here Valid values are: - nodejs6...

aalej commented 4 months ago

Thanks for the detailed report @lukaselmer. I’m able to reproduce this issue. Let me notify our engineering team to see if we can add support for the Node.js 22 runtime.