Search code examples
phpsymfonysymfony4fosuserbundle

Symfony 4.3.2 and problem with injection dependencies into FOS User Bundle controllers


I am using Symfony 4.3.2 and it seems that FOS User Bundle doesn't work with this version. Every time I try to call action from this bundle ("/register", "/profile" etc.), I get this error

Controller 'FOS\UserBundle\Controller\RegistrationController' has required constructor arguments and does not exist in the container. Did you forget to define such a service?.

It seems that there is some problem with injecting dependencies into FOS User Bundle controllers. Do you know how to solve this problem? I did not try to override default FOS User Bundle controllers. Action "/login" does work, because there is nullable argument in FOS User Bundle SecurityController.


Solution

  • I've upgraded FOS User Bundle from version 2.1.2 (latest stable) to 2.2.x-dev and that seems to solve this problem. I guess FOS User Bundle 2.1.2 is not compatible with 4.3.2 Symfony version.