Getting this Error when updating to PHP 8.1

Hi!
I’m getting this Error when I switch my Site to PHP 8.1

2022/05/10 11:06:07 [error] 98555#98555: *843381 FastCGI sent in stderr: "PHP message: PHP Fatal error:  During inheritance of JsonSerializable: Uncaught ErrorException: Return type of Carbon\CarbonInterface::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/ploi/test.dichto.org/public/wp-content/themes/sage10/vendor/nesbot/carbon/src/Carbon/CarbonInterface.php:3025
Stack trace:
#0 /home/ploi/test.dichto.org/public/wp-content/themes/sage10/vendor/nesbot/carbon/src/Carbon/CarbonInterface.php(522): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError()
#1 /home/ploi/test.dichto.org/public/wp-content/plugins/all-in-one-seo-pack/vendor/composer/ClassLoader.php(571): include('...')
#2 /home/ploi/test.dichto.org/public/wp-content/plugins/all-in-one-seo-pack/vendor/composer/ClassLoader.php(428): Composer\Autoload\includeFile()
#3 /home/ploi/test.dichto.org/public/wp-content/themes/sage10/vendor/nesbot/carbon/src/Carbon/Carbon.ph...PHP message: PHP Fatal error:  During inheritance of JsonSerializable: Uncaught ErrorException: Return type of AIOSEO\Plugin\Common\Models\Model::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/ploi/test.dichto.org/public/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php:409

My site is running fine on 8.0 but how can I fix this when I want to update to 8.1 in the next few months?
(I’m using Ploi.io on my server)
Thanks for any help!

Bump. Any updates to this? Support for PHP 8.1 is pretty important for the security updates soon.

My two cents here: IIRC, doesn’t composer show a Carbon update message after install?
Can you invoke that command to update Carbon to version 2 and check whether this fixes the error in PHP 8.1?

FWIW I just started a fresh Sage 10 app running PHP 8.1 and am not seeing this error (though I am seeing some deprecation notices). I would recommend submitting an issue in Issues · briannesbitt/Carbon · GitHub