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

2.8k Views Asked by At

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
1

There are 1 best solutions below

3
On

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.