firebase-functions icon indicating copy to clipboard operation
firebase-functions copied to clipboard

Inconsistend behaviour of defineList in deploy/emulator

Open dee-gmiterko opened this issue 1 year ago • 1 comments

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.

dee-gmiterko avatar Feb 14 '24 13:02 dee-gmiterko