phpsymfonydoctrinefixtures

Symfony Fixtures Loading :Attempted to load class "ClassUtils" from namespace "Doctrine\Common\Util"


I am using Symfony7 and PHP 8.2.

I have installed fixtures via composer using composer req orm-fixtures command.I have created my fixture as well.

When I try to execute this command : symfony console doctrine:fixtures:load, I get this error :

In BroadcastListener.php line 138:
                                                                               
Attempted to load class "ClassUtils" from namespace "Doctrine\Common\Util".  
Did you forget a "use" statement for another namespace? 

I have tried reverting doctrine/doctrine-fixtures-bundle to older version, but I still get the error.


Solution

  • I had the same issue, it seems there is a missing dependency in symfony/ux-turbo on BroadcastListener class.

    You can remove ux-turbo, if you don't need it : composer remove symfony/ux-turbo

    Or add the missing dependency : composer require doctrine/common