We have the same problem and this error we’ve got once we upgraded the PHP-version (7.2 and 7.3).
I’m trying to figure it out and find the solution but so far without any luck. Seems like “count()” is deprecated in the newer version of PHP and there must be some alternates.