Skip to content

Unable to pass parameterized config value to functions.storage.bucket(<param>).object().onFinalize #1413

Open
@indicava

Description

@indicava

Related issues

[REQUIRED] Version info

node: v16.19.1

firebase-functions: 4.4.0

firebase-tools: 12.3.0

firebase-admin: 11.9.0

[REQUIRED] Test case

create an .env file with these contents:

DEFAULT_STORAGEBUCKET=img.mydomain.com

Then create an index.js file with this function definition:


import functions from "firebase-functions"
import { defineString } from "firebase-functions/params"
const defaultBucket = defineString("DEFAULT_STORAGEBUCKET")

export const resizeImages = functions.storage.bucket(defaultBucket).object().onFinalize(async (object) => {
functions.logger.info(`defaultBucket.value() = ${defaultBucket.value()}`)
})

[REQUIRED] Steps to reproduce

run "firebase emulators:start" or "firebase deploy"

[REQUIRED] Expected behavior

Expected behavior is Storage triggered cloud function for the bucket named "img.mydomain.com"

[REQUIRED] Actual behavior

Actual behavior is I am getting this error message:

functions: Failed to load function definition from source: FirebaseError: Failed to load function definition from source: Failed to generate manifest from function source: Error: Invalid bucket name params.DEFAULT_STORAGEBUCKET

Were you able to successfully deploy your functions?

No I was unable to deploy

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions