Can't connect to firestore : Class "Google\ApiCore\Serializer" not found
theomax13 opened this issue · 1 comments
theomax13 commented
Environment details
- OS: MacOS 15.0
- PHP version: 8.2.20
- Package name and version: google/cloud-firestore -> ^0.1.0
Steps to reproduce
- composer require google/cloud-firestore
- Put the code below in a index.php file
Code example
<?php
require 'vendor/autoload.php';
use Google\Cloud\Firestore\FirestoreClient;
$firestore = new FirestoreClient([
'credentials' => json_decode(file_get_contents('./Liste-Manga-Firebase-Admin.json'), true)
]);
$collection = $firestore->collection('mangas');
Full Error
Fatal error: Uncaught Error: Class "Google\ApiCore\Serializer" not found in /Users/theo/Developer/web_scrapper/vendor/google/cloud-core/src/GrpcRequestWrapper.php:93 Stack trace: #0 /Users/theo/Developer/web_scrapper/vendor/google/cloud-firestore/Connection/Grpc.php(81): Google\Cloud\Core\GrpcRequestWrapper->__construct(Array) #1 /Users/theo/Developer/web_scrapper/vendor/google/cloud-firestore/FirestoreClient.php(110): Google\Cloud\Firestore\Connection\Grpc->__construct(Array) #2 /Users/theo/Developer/web_scrapper/index.php(6): Google\Cloud\Firestore\FirestoreClient->__construct(Array) #3 {main} thrown in /Users/theo/Developer/web_scrapper/vendor/google/cloud-core/src/GrpcRequestWrapper.php on line 93
Thanks!
bshaffer commented
google/cloud-firestore -> ^0.1.0
You should try upgrading to google/cloud-firestore:^1.0
, as the version you've listed there is very out of date.
Uncaught Error: Class "Google\ApiCore\Serializer" not found
I am not sure what version of google/gax
you're on, but in the most recent version (and since a long long time ago), that class exists. So my best guess is you need to update your packages.