需要访问 Firestore 的项目 ID 是必需的错误。

huangapple go评论81阅读模式
英文:

Project ID Required to Access Firestore Error

问题

我希望使用Firebase Admin SDK,但出现了一个“需要项目ID才能访问Firestore错误”的问题。

我从Firebase控制台下载了一个admin-sdk的JSON文件,并将其放在调用它的文件的同一目录中。

opt := option.WithCredentialsFile("../<FILENAME>.json")

凭据文件中包含了项目ID,但由于某种原因,opt变量无法从凭据文件中提取数据,因此在尝试获取Firestore客户端时出现了此错误。

谢谢!

英文:

I wish to use the firebase admin-sdk but for some reason, I am getting a "project id is required to access Firestore error".

I have downloaded an admin-sdk json file from the firebase console and I have placed it in the same directory as the file that calls it.

opt := option.WithCredentialsFile(&quot;../&lt;FILENAME&gt;.json&quot;)

The credentials file has the project id but for some reason the opt variable is unable to extract data from the credentials file, and as a result when I try to get the firestore client this error is occuring.

Thanks!

答案1

得分: 4

问题解决了,我使用了错误的绝对路径。

英文:

Problem solved, I was using the wrong absolute path.

huangapple
  • 本文由 发表于 2021年6月9日 10:52:42
  • 转载请务必保留本文链接:https://go.coder-hub.com/67896897.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定