Alex Seif
Alex Seif

Reputation: 308

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

Upvotes: 7

Views: 2900

Answers (1)

dahe
dahe

Reputation: 846

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.

Upvotes: 6

Related Questions