Skip to content

Inconsistend behaviour of defineList in deploy/emulator #1523

Closed
@dee-gmiterko

Description

@dee-gmiterko

Related issues

[REQUIRED] Version info

node:

v20.10.0

firebase-functions:

4.7.0

firebase-tools:

12.5.2

firebase-admin:

12.0.0

[REQUIRED] Test case

index.js

import { defineList } from "firebase-functions/params";

const listParam = defineList("LIST");

console.log(listParam.value());

.env

LIST=["a", "b", "c"]
  • When running function in emulator listParam.value() returns ["a", "b", "c"]
  • However after deployment it would return ['["a"', '"b"', '"c"]'] not parsing JSON, but splitting on commas
  • I was also unable to decide which behavior is correct as I wasn't able to locate documentation stating either one is correct.

[REQUIRED] Expected behavior

To have defineList behavior be consistent across emulator and production, and documented.

[REQUIRED] Actual behavior

defineList parses value in .env file differently causing it to became ['["a"', '"b"', '"c"]'].

Were you able to successfully deploy your functions?

Yes, but behaves unexpectedly.

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