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

Correction of a problem where export to dotenv fails if the config value is operated with empty characters in the 1st gen of functions.

Open ytetsuro opened this issue 1 year ago • 3 comments

Description

Correction of a problem where export to dotenv fails if the config value is operated with empty characters in the 1st gen of functions. Fixes https://github.com/firebase/firebase-tools/issues/7036 and fixes #7460

Scenarios Tested

TypeError: Cannot read properties of undefined (reading 'replace')
    at escape (/Users/yoshikawa/.nodebrew/node/v20.10.0/lib/node_modules/firebase-tools/lib/functions/runtimeConfigExport.js:128:14)
    at /Users/yoshikawa/.nodebrew/node/v20.10.0/lib/node_modules/firebase-tools/lib/functions/runtimeConfigExport.js:131:100
    at Array.map (<anonymous>)
    at Object.toDotenvFormat (/Users/yoshikawa/.nodebrew/node/v20.10.0/lib/node_modules/firebase-tools/lib/functions/runtimeConfigExport.js:131:24)
    at /Users/yoshikawa/.nodebrew/node/v20.10.0/lib/node_modules/firebase-tools/lib/commands/functions-config-export.js:110:56
    at Array.map (<anonymous>)
    at Command.actionFn (/Users/yoshikawa/.nodebrew/node/v20.10.0/lib/node_modules/firebase-tools/lib/commands/functions-config-export.js:110:28)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Sample Commands

ytetsuro avatar Jun 24 '24 02:06 ytetsuro

@taeold

I consider this to be a bug fix. I can't seem to find a place in README.md to mention change log.

Does this mean that a summary of the config:export command should be written in the following section?

https://github.com/firebase/firebase-tools/blob/master/README.md?plain=1#L144

I don't mind writing, but I am not good at English. I would like to add the following sentence, is that OK?

To migrate for environment variables, export your existing environment configurations using the firebase functions:config:export command.

ytetsuro avatar Aug 05 '24 07:08 ytetsuro

A bug fix does have a place in the CHANGELOG.md. I usually write something short like:

"Fix bug where dotenv didn't support emtpy string as value"

taeold avatar Aug 22 '24 17:08 taeold

@taeold

Thanks, added CHANGELOG.md.

ytetsuro avatar Aug 27 '24 12:08 ytetsuro