FriendsOfSymfony / FOSMessageBundle

User-to-user messaging bundle for Symfony
356 stars 183 forks source link

The service "fos_user.resetting.controller" has a dependency on a non-existent service "templating". #324

Closed lbcd closed 5 years ago

lbcd commented 6 years ago

On Symfony 4.0 Just to share an issue where error message didn't help.

Here was the message: The service "fos_user.resetting.controller" has a dependency on a non-existent service "templating".

What I have done to solve it => add in fos_user.yaml:

service:
    mailer: fos_user.mailer.twig_swift 

So my complete fos_user.yaml is:

fos_user:
    db_driver: orm # other valid values are 'mongodb' and 'couchdb'
    firewall_name: main
    user_class: App\Entity\User
    service:
         mailer: fos_user.mailer.twig_swift
    from_email:
        address: "%env(resolve:MAILER_USER)%"
        sender_name: "%env(resolve:MAILER_USER)%"
thib92 commented 6 years ago

I had the same issue.

You need to run composer install templating (using Flex). Then, in the framework.yaml file, add the following config :

templating:
        engines: ['twig']
hex333ham commented 5 years ago

needs adding to the documentation somewhere (known issues?)

this is relatively easily googleable and should be setup as part of another bundle or Symfony

hex333ham commented 5 years ago

added the step to check regardless