Closed
Description
[REQUIRED] Environment info
firebase-tools: 11.18.0
Platform: macOS
[REQUIRED] Test case
Params docs https://firebase.google.com/docs/functions/config-env#params state
// To use configured parameters inside the config for a function, provide them
// directly. To use them at runtime, call .value() on them.
However, attempting to use this in a typescript deployment of a function;
import { defineString } from 'firebase-functions/params';
...
const vpcConnector = defineString('MY_VPC');
export const someFunction = functions
.region('europe-west2')
.runWith({
vpcConnector: vpcConnector,
vpcConnectorEgressSettings: 'ALL_TRAFFIC'
})
.https.onCall(async (data, context) => {
...
Leads to TS error Type 'StringParam' is not assignable to type 'string | ResetValue | undefined'. Type 'Param<string>' is not assignable to type 'ResetValue'.
I can vpcConnector: vpcConnector.value()
but from the docs, this seems like an incorrect approach?
[REQUIRED] Steps to reproduce
See example above.
[REQUIRED] Expected behavior
Use variables created from defineString
in runtime config in TS function
[REQUIRED] Actual behavior
Types won't allow return value of defineString to be used in runtime config.