-
-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initialize error 'Unable to create a FirestoreClient: Error rendering...' #19
Comments
Hm, this looks like if perhaps the composer autoloader has lost some information - could you try doing a I'm just guessing, but the error hints at the project ID not being available, and the project ID is always included in the service account JSON. |
Thank you for your prompt reply.
We are now thinking about how to respond. |
I tried And |
That's the way it is, yes. As soon as you provide a service account, the factory will not try to auto-discover the credentials after that. You are not receiving the error in that line, the most common reason for this error is that you are not using the same factory that you initialized. As an example: $factory = (new Factory())->withServiceAccount('...');
Here, the second line will return a new instance of the factory, the previous `$factory` will be untouched
$factory->withDatabaseUrl('...');
// Correct would have been
$factory = $factory->withDatabaseUrl('...'); |
Hi, Kreait Team. Thank you. |
Oh, I just realized that we are in the context of the Laravel Package 😅 - here you normally shouldn't need to invoke the Factory manually at all. Could you tell me more about why you are doing |
I saw this page and wrote the program. https://firebase-php.readthedocs.io/en/stable/cloud-firestore.html Now, when I reviewed Readme.md again, it was written. I missed it without noticing. |
Hi, jeromegamez. The program I wrote now looks like.
How can I write this in a form suitable for Laravel without using "new factory ()"? |
In Laravel, you could do for example: $database = app('firebase.firestore')->database();
$var_list = $database->collection('tokens')->document('tokens')->snapshot(); |
Thank you for your reply. It was not a problem with your library. |
If you‘re satisfied with the outcome, of course :). Please fell free to create a new issue or ask on Discord if you have further questions! |
Today I suddenly got this issue after run config:cache then I figured out that it only read FIREBASE CREDENTIALS in .env not GOOGLE_APPLICATION_CREDENTIALS |
The behaviour should be that it first tries to read from laravel-firebase/config/firebase.php Line 50 in d5b468f
|
today I have same problem after I ran php artisan config:cache. After I ran: php artisan config:clear |
For anyone who comes after me, I had this issue when using |
Hello.
This library is very easy to use. I thank you.
It's working is 2 days ago.
Not working today.
I don't change files
.env
andfirebase_credential.json
.Please let me know if you have any cause.
error message:
Version:
The text was updated successfully, but these errors were encountered: