After update from php 7.2 to Php 8.1 show this error :
Spectrum :
OH CRAP!
syntax error, unexpected token "\"
After update from php 7.2 to Php 8.1 show this error :
Spectrum :
OH CRAP!
syntax error, unexpected token "\"
Ho.
As fist step as Joomla Investigator - enable that:

Then check from where you have error, which file(s) is on table location 1 and 2
Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/site1/libraries/src/Uri/Uri.php on line 143
Also that message doesn't help :/ too short !!
Switch to PHP 8.0 and test again.
Have you updated all extensions and template to new version?
If you are not sure, check one by one.