Skip to content

Using parameters for minInstances runtime option fails during deployment with ESM (v7.0.0) #1775

@weevilgenius

Description

@weevilgenius

Using a parameterized config value in an ESM project for a function's minInstances runtime option fails to deploy with a CEL expression 'params.MY_PARAMETER' is of an unsupported form error. It works in v6.6.0 and below and also works if you change your project to CommonJS.

Version info

node: 24.11.1

firebase-functions: 7.0.0

firebase-tools: 14.26.0

firebase-admin: N/A

Test case

With "type": "module" in your package.json:

import { onRequest } from "firebase-functions/https";
import { defineInt } from "firebase-functions/params";

const CRITICAL_HOT_INSTANCES = defineInt('CRITICAL_HOT_INSTANCES', {
  description: 'How many instances to keep hot for critical functions?',
  default: 0,
});

export const exampleFunc = onRequest({ minInstances: CRITICAL_HOT_INSTANCES },
  (req, res) => {
    res.send("Hello, world!");
  }
);

Steps to reproduce

Deploy the function using Firebase CLI: firebase deploy --only functions:exampleFunc

Expected behavior

Function deploys with minInstances set by the parameter.

Actual behavior

$ firebase deploy --only functions:exampleFunc

=== Deploying to 'dev'...

i  deploying functions
Running command: pnpm run build

> [email protected] build /Users/user/projects/functions-bug
> tsc

✔  functions: Finished running predeploy script.
i  functions: preparing codebase default for deployment
i  functions: ensuring required API cloudfunctions.googleapis.com is enabled...
i  functions: ensuring required API cloudbuild.googleapis.com is enabled...
i  artifactregistry: ensuring required API artifactregistry.googleapis.com is enabled...
i  functions: Loading and analyzing source code for codebase default to determine what to deploy
Serving at port 8857

i  extensions: ensuring required API firebaseextensions.googleapis.com is enabled...
i  functions: Loaded environment variables from .env, .env.dev.

Error: CEL expression 'params.CRITICAL_HOT_INSTANCES' is of an unsupported form

Note that deployment halts immediately and no firebase-debug.log is produced.

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