1

I have this error:

The service "fos_ck_editor.renderer" has a dependency on a non-existent service "twig".

My framework config in app/config/config.yml:

framework:
    #esi: ~
    #translator: { fallbacks: ['%locale%'] }
    secret: '%secret%'
    router:
        resource: '%kernel.project_dir%/app/config/routing.yml'
        strict_requirements: ~
    form: ~
    csrf_protection: ~
    validation: { enable_annotations: true }
    #serializer: { enable_annotations: true }
    default_locale: '%locale%'
    trusted_hosts: ~
    session:
        # https://symfony.com/doc/current/reference/configuration/framework.html#handler-id
        handler_id: session.handler.native_file
        save_path: '%kernel.project_dir%/var/sessions/%kernel.environment%'
    fragments: ~
    http_method_override: true
    assets:
        version: 13
        version_format: '%%s?v%%s'
    php_errors:
        log: true
    templating:
        engines: ['twig']

My twig config in app/config/admin/config.yml

twig:
    debug: '%kernel.debug%'
    strict_variables: '%kernel.debug%'
    form_themes:
        - '@AppyfuriousFiles/Form/fields.html.twig'
        - '@Admin/fields.html.twig'
        - '@FOSCKEditor/Form/ckeditor_widget.html.twig'
DarkBee
  • 16,592
  • 6
  • 46
  • 58
maria d.xx
  • 11
  • 1
  • Can you show where is defined your services : `fos_ck_editor.renderer` ? Also not sure it can help because I'm under SonataAdmin and not EasyAdmin, but I have the same things as you have in your `config.yaml` except for me it's in a `twig.yaml`. In addition to that I have a `twig_extensions.yaml` with this content `services: _defaults: public: false autowire: true autoconfigure: true` – Kurano Mar 02 '20 at 15:12

1 Answers1

0

I found the origin of my problem:

In my AppKernel.php I've added to the common (app) environment:

$bundles[] = new FOS\CKEditorBundle\FOSCKEditorBundle();

But I've only added it to the admin environment, admin_prod, admin_dev and admin_test. Because my API doesn't need this bundle and the ServiceNotFoundException I get whenever I sent a request to my API. I hope, my explanations are clear...

DarkBee
  • 16,592
  • 6
  • 46
  • 58
maria d.xx
  • 11
  • 1