When I try to deploy my firebase functions I get the following error using the --debug option:
[2023-04-27T14:33:31.762Z] > [functions] package.json contents: {
"name": "functions",
"scripts": {
"lint": "eslint --ext .js,.ts .",
"build": "tsc",
"watch": "tsc --watch",
"deploy": "firebase deploy --only functions",
"logs": "firebase functions:log",
"emulate-functions": "~/projects/scripts/kill-emulator.sh | tsc -w | firebase emulators:start --only functions --inspect-functions",
"emulate-debug": "~/projects/scripts/kill-emulator.sh | tsc -w | firebase emulators:start --inspect-functions",
"emulate": "kill-emulator.sh | tsc -w | firebase emulators:start"
},
"comments": {
"emulate-functions": "Can be used to debug HTTP callable cloud functions. To debug cloud triggered function firestore emulator must be running. Because of debugger support, functions will not be running in parallel",
"emulate-debug": "Runs all emulators with the functions debugging enabled",
"emulate": "Runs all emulator with the fungtions debugger disabled. Give the best emulation, but functions cannot be debugged",
"note1": "npm run emulate -- --import=seeds/latest --export-on-exit=seeds/latest will run the emulator with persistant data. (seeds folder must exist, before you start)",
"note2": "Emulator is best run from the functions folder. If it is run from the docavea folder, functions code does not reload correctly"
},
"main": "lib/src/index.js",
"dependencies": {
"@sendgrid/mail": "^7.7.0",
"api2pdf": "^1.1.1",
"axios": "^0.19.2",
"firebase-admin": "^11.7.0",
"firebase-functions": "^4.3.1",
"firebase-tools": "^11.28.0",
"googleapis": "^111.0.0",
"lodash": "^4.17.21",
"mailchimp-api-v3": "^1.13.1",
"md5": "^2.2.1",
"onedrive-api": "^1.0.4",
"pdf-lib": "^1.17.1",
"php-serialize": "^3.0.1",
"source-map-support": "^0.5.21"
},
"engines": {
"node": "16"
},
"devDependencies": {
"@types/lodash": "^4.14.191",
"@types/node": "^16",
"@types/php-serialize": "^3.0.0",
"@typescript-eslint/eslint-plugin": "^5.53.0",
"@typescript-eslint/parser": "^5.53.0",
"eslint": "^8.39.0",
"eslint-config-google": "^0.14.0",
"eslint-plugin-import": "^2.27.5",
"typescript": "^4.9.5"
},
"private": true
}
[2023-04-27T14:33:31.763Z] Building nodejs source
[2023-04-27T14:33:31.764Z] Could not find functions.yaml. Must use http discovery
[2023-04-27T14:33:32.064Z] Serving at port 9005
[2023-04-27T14:33:42.426Z] Got response from /__/functions.yaml Failed to generate manifest from function source: TypeError: Cannot read properties of undefined (reading 'storage')
[2023-04-27T14:33:42.428Z] Failed to parse functions.yamlincomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line at line 1, column 60:
... from function source: TypeError: Cannot read properties of unde ...
^ {"name":"YAMLException","reason":"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line","mark":{"name":null,"buffer":"Failed to generate manifest from function source: TypeError: Cannot read properties of undefined (reading 'storage')\n\u0000","position":59,"line":0,"column":59},"message":"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line at line 1, column 60:\n ... from function source: TypeError: Cannot read properties of unde ... \n ^"}
[2023-04-27T14:33:42.446Z] shutdown requested via /__/quitquitquit
Error: Failed to load function definition from source: Failed to generate manifest from function source: TypeError: Cannot read properties of undefined (reading 'storage')
I don't understand this part of the log "Could not find functions.yaml. Must use http discovery". I have read this answer Firebase Deployment failure - Could not find functions.yaml. Must use http discovery 1. and 2. are setup correctly (I never had problems deploying before) and I have tried to rerun firebase init without any improvement. I have also tried to delete all function on the server.
What is functions.yaml?
- Am I supposed to have one? (I cannot find a file of that name on my disk)
- Where should it be located?
- What should I put in the file?
- Where can I find documentation on functions.yaml?