1

I try to install sonata admin user bundle in symfony 4 project:

composer create-project symfony/website-skeleton my-project composer require sonata-project/admin-bundle 

But I get this error:

Script cache:clear returned with error code 1 !! !! In CheckExceptionOnInvalidReferenceBehaviorPass.php line 32: !! !! The service "sonata.admin.block.admin_list" has a dependency on a non-existent service "templating". 

What can I do?

1
  • 1
    Do you have twig installed? Commented Feb 3, 2018 at 16:10

2 Answers 2

1

One of the differences between S3 and S4 is that the framework itself no longer has any template engines by default. The usual twig stuff still works as long as you have installed the website-skeleton or manually installed twig. But still no templating service.

You need to:

composer require templating 

And then set the templating engine in your framework config:

# config/packages/framework.yaml templating: engine: 'twig' 

After that you can verify that you have a templating service with bin/console debug:container

And though I don't use the sonata admin bundle myself, it seems to install cleanly at least.

Bit of a mystery as to why the template recipe is not installed as part of the website-skeleton. But oh well.

Sign up to request clarification or add additional context in comments.

2 Comments

I follow all installation steps by sonata-project.org/bundles/admin/master/doc/getting_started/… and try 127.0.0.1:8000/admin/dashboard but now i have Twig_Error_Loader There are no registered paths for namespace "SonataCore" in @SonataAdmin\standard_layout.html.twig at line 331.
All I did was to track down the lack of a templating service. I suspect that there is no released version compatible with S4. Could try loading the development version or checking the github issues. I don't use the bundle myself.
0

There is already an issue reported on their github, you can find the solution to your problem here :

https://github.com/sonata-project/SonataAdminBundle/issues/4910#issuecomment-360587312

1 Comment

Have you actually tried the solution in your link only answer? It does not actually work nor solve the underlying issue of the template component not being installed and hence no template service.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.