Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FOS UserBundle UserManager::__construct() must be an instance of ObjectManager

Fresh installation of symfony 4.4, then symfony flex and some common recipes, then I was trying to setup fos userbundle, I have this issue I cannot get around.

Argument 3 passed to FOS\UserBundle\Doctrine\UserManager::__construct() must be an instance of Doctrine\Common\Persistence\ObjectManager, instance of Doctrine\ORM\EntityManager given, called in /srv/www/alexseif/var/cache/dev/ContainerYzHcxci/srcApp_KernelDevDebugContainer.php on line 1660
like image 206
Alex Seif Avatar asked Oct 03 '20 17:10

Alex Seif


1 Answers

Aside from the FOSUserBundle being no longer maintained, and therefor shouldn't be used in new Projects, I had to solve this problem too:

Adding "doctrine/common": "^2.8", to the composer.json was enough in my case.

like image 92
dahe Avatar answered Nov 06 '22 19:11

dahe