我创建了一个使用这个配置库的firebase函数
https://www.npmjs.com/package/config
.当我在本地运行它时,一切都正常。
当我试图部署时,
firebase deploy --only functions
函数文件夹中的配置目录和相关文件似乎没有上载。我的函数在尝试读取配置值时失败。
如何告诉FireBase将配置目录与函数一起部署?
更新
文件夹结构是
FireBase输出低于
root@fc19e6bca144:/appfiles# firebase deploy --only functions
=== Deploying to 'familybank'...
i deploying functions
i functions: ensuring necessary APIs are enabled...
â functions: all necessary APIs are enabled
i functions: preparing functions directory for uploading...
Error: Error occurred while parsing your function triggers.
Error: Configuration property "dialogflow.intents.welcome_user" is not defined
at Config.get (/appfiles/functions/node_modules/config/lib/config.js:203:11)
at Object.<anonymous> (/appfiles/functions/index.js:39:19)
at Module._compile (internal/modules/cjs/loader.js:707:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:718:10)
at Module.load (internal/modules/cjs/loader.js:605:32)
at tryModuleLoad (internal/modules/cjs/loader.js:544:12)
at Function.Module._load (internal/modules/cjs/loader.js:536:3)
at Module.require (internal/modules/cjs/loader.js:643:17)
at require (internal/modules/cjs/helpers.js:22:18)
at /usr/local/lib/node_modules/firebase-tools/lib/triggerParser.js:15:15
at Object.<anonymous> (/usr/local/lib/node_modules/firebase-tools/lib/triggerParser.js:53:3)
at Module._compile (internal/modules/cjs/loader.js:707:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:718:10)
at Module.load (internal/modules/cjs/loader.js:605:32)
at tryModuleLoad (internal/modules/cjs/loader.js:544:12)
dialogflow.intents.welcome_user
提供在
config/defaults.json
,所以我假设它没有上传。