params.defineList is always parsed as undefined in v6
Related issues
I searched but did not find any
[REQUIRED] Version info
node: v22.21.0 (via nvm)
firebase-functions: 6.6.0
firebase-tools: 14.25.0
firebase-admin: 13.6.0
[REQUIRED] Test case
// runtimeConfig.ts export const allowedOrigins = params.defineList('ALLOWED_ORIGINS');
// used in a function file import * as config from '../runtimeConfig'; // I know this isn't "supposed" to be here, but needed a call outside of the function signature to get access to the cors content. I also tried to resolve it first in onInit but that was also unsuccessful.
const allowedOrigins = config.allowedOrigins;
export const loginToPortal = functions.https.onRequest( { cors: allowedOrigins as unknown as string[], secrets: config.noteableSecrets }, async (request, response) => {...}
// .env.projectId // I tried many variations of an array syntax here including just a string, comma separated, surround with single quotes, etc. Nothing worked ALLOWED_ORIGINS=["https://mywebsite.com", "https://app.mywebsite.com"]
[REQUIRED] Steps to reproduce
Run:
firebase deploy --only functions
[REQUIRED] Expected behavior
A successful deploy (which does work when I return to functions v5 and admin v12)
[REQUIRED] Actual behavior
This did not produce a firebase-debug.log file.
➜ firebase deploy --only functions
=== Deploying to '
i deploying functions Running command: npm --prefix "$RESOURCE_DIR" run build
build npm run lint && tsc
lint eslint
- 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... ! functions: package.json indicates an outdated version of firebase-functions. Please upgrade using npm install --save firebase-functions@latest in your functions directory. ! functions: Please note that there will be breaking changes when you upgrade. i functions: Loading and analyzing source code for codebase default to determine what to deploy Serving at port 8910
{"severity":"WARNING","message":"params.ALLOWED_ORIGINS.value() invoked during function deployment, instead of during runtime."}
{"severity":"WARNING","message":"This is usually a mistake. In configs, use Params directly without calling .value()."} {"severity":"WARNING","message":"example: { memory: memoryParam } not { memory: memoryParam.value() }"}
SyntaxError: "undefined" is not valid JSON
at JSON.parse (
Error: Functions codebase could not be analyzed successfully. It may have a syntax or runtime error
Were you able to successfully deploy your functions?
no
Hi @joelnwalkley
Thanks for reporting this issue! It has been received and will be reviewed as soon as possible.