firebase-functions-helper icon indicating copy to clipboard operation
firebase-functions-helper copied to clipboard

Service account does not recognize project_id

Open vicdotdevelop opened this issue 4 years ago • 5 comments

Hey,

I wanted to use your library to upload a json with an auto-generated id to firestore. As I was using firestore-import-export and it worked quite well, I wanted to switch over to this lib, as it has the auto-generated id. Nevertheless, when I try to call initializeApp with the serviceAccount it says:

Error: Service account object must contain a string "project_id" property.

Even though it has this value in the serviceaccount.json file I have downloaded from firebase. It is also the same file that was working with the firestore-import-export lib.

any help :) ?

vicdotdevelop avatar Oct 22 '21 08:10 vicdotdevelop

One thing that I can think of is to manually add the project_id to the serviceAccount. Let me know if it works.

dalenguyen avatar Oct 22 '21 15:10 dalenguyen

the project_id is actually in the serviceAccount.json file. @dalenguyen

vicdotdevelop avatar Oct 23 '21 13:10 vicdotdevelop

Does your serviceAccount.json look something like this?

image

dalenguyen avatar Oct 23 '21 16:10 dalenguyen

Does your serviceAccount.json look something like this?

image

Yes it looks exactly like this

vicdotdevelop avatar Oct 24 '21 17:10 vicdotdevelop

Hi @victorblaess, it's hard to tell what happened. It would be great if you can share some snapshots of your project structure. The command & errors that occur. You can sensor sensitive information before posting.

dalenguyen avatar Oct 24 '21 19:10 dalenguyen