skip to Main Content

I’ve recently upgraded to Laravel 10 and am trying to simply run composer up. My composer file looks like:

"require": {
    "php": "^8.2",
    ...
    "laravel/socialite": "^5",
    ...
    "socialiteproviders/apple": "^5"
},

However, I’m getting the error:

PHP Fatal error: Declaration of SocialiteProvidersAppleProvider::refreshToken(string $refreshToken): PsrHttpMessageResponseInterface must be compatible with LaravelSocialiteTwoAbstractProvider::refreshToken($refreshToken) in /Users/user/Sites/site/vendor/socialiteproviders/apple/Provider.php on line 289

It seems like I have the latest providers for both Apple and Socialite, and this isn’t custom code in any sense, so I’m not sure what to do with this. Any thoughts would be greatly appreciated!

2

Answers


  1. To resolve this issue, you may need to check for updates or changes in the Apple Socialite provider repository. Make sure that you are using versions that are compatible with each other.

    Here are a few steps you can take to resolve the issue:

    Check Compatibility: Review the release notes and documentation for both Laravel Socialite and the Apple Socialite provider to ensure that you are using versions that are meant to work together. Sometimes, breaking changes in one package require updates in another.

    Update Dependencies: Update your composer.json file to use the latest compatible versions of both Laravel Socialite and the Apple Socialite provider.

    You can use the following commands:

    composer require laravel/socialite:^5.0
    composer require socialiteproviders/apple:^5.0
    

    Replace 5.0 with the appropriate version numbers compatible with each other.

    Check GitHub Repositories: Visit the GitHub repositories for Laravel Socialite and the Apple Socialite provider. Look for any open issues or discussions related to compatibility problems. There might be guidance or a fix provided by the maintainers or the community.

    Community Support: If you can’t find a quick fix or solution, consider reaching out to the Laravel or Socialite community. Forums, GitHub discussions, or other community channels may have users who have faced similar issues.

    Remember to backup your code or commit your changes before making any updates to ensure you can easily revert to a previous state if needed.

    Login or Signup to reply.
  2. According to this link https://github.com/laravel/socialite/issues/677, you won’t be able to run it if you attempt to use version 5.11 of socialite. You can temporarily force version 5.10 as a hack until a new version that corrects the errors is released. I faced the same problem while installing Bookstack, and my temporary solution was to edit composer.json and change the line

        "laravel/socialite": "^5.8",
    

    to

        "laravel/socialite": "5.10",
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search