Skip to content
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

Can't connect to firestore : Class "Google\ApiCore\Serializer" not found #7689

Open
theomax13 opened this issue Sep 20, 2024 · 1 comment
Open

Comments

@theomax13
Copy link

theomax13 commented Sep 20, 2024

Environment details

  • OS: MacOS 15.0
  • PHP version: 8.2.20
  • Package name and version: google/cloud-firestore -> ^0.1.0

Steps to reproduce

  1. composer require google/cloud-firestore
  2. 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
Copy link
Contributor

bshaffer commented Sep 24, 2024

@theomax13

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants