Skip to content

ng deploy generates a Cloud Function that targets the decommissioned Node 14 runtime and crashes on firebase-functions 6 #3742

Description

@armando-navarro

Version info

Angular: any supported by current AngularFire

AngularFire: main today, and every release since the firebase-functions 6 upgrade

How to reproduce these conditions

ng deploy with SSR generates the Cloud Function it deploys from the templates in src/schematics/deploy/functions-templates.ts. Three defects in what it generates:

  1. The default runtime is Node 14. DEFAULT_NODE_VERSION = 14, and nothing sets functionsNodeVersion by default, so the generated manifest carries "engines": { "node": "14" }. Cloud Functions decommissioned the nodejs14 runtime in early 2025 and deployment with it is disabled. The same constant also picks the Cloud Run base image (FROM node:14-slim), a tag last rebuilt in 2023.

  2. The gen 1 function crashes at cold start on firebase-functions 6. The default template emits const functions = require('firebase-functions') and calls functions.region(...). On firebase-functions 6, which this repo depends on (^6.1.0), the v1 API lives on the firebase-functions/v1 subpath and region is not on the package root. Running the generated file verbatim:

    TypeError: functions.region is not a function
    

    This is the default path, since CF3v2 has no default and nothing sets it.

  3. The docs example is out of date. docs/deploy/getting-started.md shows "functionsNodeVersion": 12, another decommissioned runtime.

Expected behavior

The generated function declares a runtime Cloud Functions accepts and loads against the firebase-functions major this repo depends on.

Actual behavior

The deploy is refused for the dead runtime, and a function that does reach deployment dies on its first request.

Related: #3676.

Metadata

Metadata

Assignees

No one assigned

    Labels

    comp: schematicsng add / deploy schematics (src/schematics).comp: ssrServer-side rendering, hydration, @angular/ssr interop.type: bugDefect: expected behavior doesn't happen.version: current (v17+)Targets the current modular API (v17+).

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions