3

I'm trying to deploy a firebase cloud function, but I keep getting this error. The weirdest part is that I had it working fine but switched from firebase talking to cloud vision over to firebase talking to google documentation. And suddenly, this error appeared. I've tried several different versions of firebase tools and NodeJS but have yet to be able to fix the issue. Here is the error below.

[2023-02-28T17:29:15.917Z] Building nodejs source
[2023-02-28T17:29:15.922Z] Could not find functions.yaml. Must use http discovery
[2023-02-28T17:29:15.935Z] Found firebase-functions binary at 'C:\Users\crisb\source\repos\Javascriptcouldfunction4\functions\node_modules\.bin\firebase-functions'
[2023-02-28T17:29:17.570Z] Serving at port 8704

[2023-02-28T17:29:19.519Z] Got response from /__/functions.yaml Failed to generate manifest from function source: TypeError [ERR_INVALID_ARG_TYPE]: The "id" argument must be of type string. Received an instance of Object
[2023-02-28T17:29:19.522Z] 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 83:
     ... TypeError [ERR_INVALID_ARG_TYPE]: The "id" argument must be of t ...
                                         ^ {"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 [ERR_INVALID_ARG_TYPE]: The \"id\" argument must be of type string. Received an instance of Object\n\u0000","position":82,"line":0,"column":82},"message":"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line at line 1, column 83:\n     ... TypeError [ERR_INVALID_ARG_TYPE]: The \"id\" argument must be of t ... \n                                         ^"}
[2023-02-28T17:29:19.528Z] shutdown requested via /__/quitquitquit


Error: Failed to load function definition from source: Failed to generate manifest from function source: TypeError [ERR_INVALID_ARG_TYPE]: The "id" argument must be of type string. Received an instance of Object

I've tried several different versions of firebase tools and NodeJS but have yet to be able to fix the issue. I rebuilt the entire project from scratch but still got the same issue.

desertnaut
  • 57,590
  • 26
  • 140
  • 166
  • If you are using the Firebase CLI, try running the `firebase init` command again to reinitialize your Firebase project. Try running the `firebase deploy --only` functions command instead of just `firebase deploy`. – Chanpols Mar 06 '23 at 20:06
  • I appreciate the suggestion. Neither solution got rid of the error. – cristopher blunt Mar 09 '23 at 15:52
  • Did you figure it out? having same err – Yewla May 18 '23 at 18:10
  • I recently used GitHub Actions to build my project, and I encountered a similar error as you did. I manually created the `functions.yaml` file. First, I created a `functions.yaml` file that same level with `index.js` and `package.json`. Then, I located the content of `functions.yaml` by running `firebase emulators:start --debug`. You can see the log message 'Found functions.yaml. Got spec:' and copy the JSON content into the `functions.yaml` file. Finally, try to run the deployment. I'm hopeful that the Firebase Functions team will address this issue in the next update. – Giang Aug 29 '23 at 16:55

2 Answers2

0

The functions.yaml configuration file, which Firebase uses to define your cloud functions, appears to be having a problem.

Here are some options you might want to consider:

  1. Check if the functions directory is in the correct location in your project. It should be in the root directory of your project.
  2. Make sure that the functions directory contains the necessary files, including index.js, package.json, and functions.yaml.
  3. Double-check your functions.yaml file to ensure that it is properly formatted. It should include the name, memory, timeout, and runtime fields for each of your functions.
  4. If you are using the Firebase CLI, try running the firebase init command again to reinitialize your Firebase project.

If none of these fixes work, there might be a Firebase bug. You might try contacting Firebase support in that situation for advice.

Chanpols
  • 1,184
  • 1
  • 3
  • 13
0

from my experience:

if someone encountered the same issue do not abort any ting in your project before:

CHECKING YOUR CONNECTION INTERNET FIRST, it should b enough to upload your files to firebase.

desertnaut
  • 57,590
  • 26
  • 140
  • 166