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

1

7

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
Baleful answered 3/10, 2020 at 17:44 Comment(0)
R
6

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.

Randolf answered 5/10, 2020 at 12:56 Comment(3)
Thank you, I will try that.. MAN FOS is out, I guess we gotta work on old projects again xDBaleful
How "nice" is to end up using libs just before the end of their life... lot of fun.. 😶Markswoman
Package doctrine/reflection is abandoned, you should avoid using it. Use roave/better-reflection instead.Parabolize

© 2022 - 2024 — McMap. All rights reserved.