je-buy 01
je-buy 01

Reputation: 35

service error after upgraded from symfony 3.3 to symfony 3.4

I've upgraded my symfony projet version from 3.3 to 3.4 a few month ago and everything woked find but i recently tried to ad an event listener and then i've got that error

The configuration key "public" cannot be used to define a default value in "/home/pc-dev/Labs/Projets-jebuy/je-buy.com/app/config/services.yml". Allowed keys are "private", "tags", "autowire", "autoconfigure", "bind" in /home  
  /pc-dev/Labs/Projets-jebuy/je-buy.com/app/config/services.yml (which is being imported from "/home/pc-dev/Labs/Projets-jebuy/je-buy.com/app/config/config.yml"). 

obviuosly nothing seriuos i edited the default service.yml file from this

    # default configuration for services in *this* file
    _defaults:
        # automatically injects dependencies in your services
        autowire: true
        # automatically registers your services as commands, event subscribers, etc.
        autoconfigure: true
        # this means you cannot fetch services directly from the container via $container->get()
        # if you need to do this, you can override this setting on individual services
        public: false
    twig.extension:
        class: AppBundle\Twig\Extension\MenuExtension
        arguments:
            - '@doctrine'
        tags:
            - {name : twig.extension }
#    service.extension:
#        class: AdminBundle\DependencyInjection\AdminExtension
#        arguments: []
#        tags: []

to this (because in symfony 3.4 or 4, all services are by default private)

services:
    # default configuration for services in *this* file
    _defaults:
        # automatically injects dependencies in your services
        autowire: true
        # automatically registers your services as commands, event subscribers, etc.
        autoconfigure: true
        # this means you cannot fetch services directly from the container via $container->get()
        # if you need to do this, you can override this setting on individual services
        private: true
    twig.extension:
        class: AppBundle\Twig\Extension\MenuExtension
        arguments:
            - '@doctrine'
        tags:
            - {name : twig.extension }
#    service.extension:
#        class: AdminBundle\DependencyInjection\AdminExtension
#        arguments: []
#        tags: []

but when i tried to run the server i've now got this error

 The service "templating.loader.cache" has a dependency on a non-existent service "templating.loader.wrapped".

and i don't now how to solve it and where is that template.loder.wrapped service.

Upvotes: 1

Views: 305

Answers (0)

Related Questions