sampart / BreadcrumbsBundle

A small breadcrumbs bundle for Symfony
Other
188 stars 68 forks source link

The service "white_october_breadcrumbs.helper" has a dependency on a non-existent service "templating". #85

Closed quentin-st closed 6 years ago

quentin-st commented 6 years ago

Registering this bundle in a Symfony 3.4 project triggers the following exception:

The service "white_october_breadcrumbs.helper" has a dependency on a non-existent service "templating".

Is there any known workaround?

althaus commented 6 years ago

Do you have Twig enabled?

quentin-st commented 6 years ago

Sure I do! That's on a fresh Symfony 3.4 install

althaus commented 6 years ago

I've just upgraded my project from 3.3.x to 3.4.1 and bundle works fine with some deprecation notes.

bocharsky-bw commented 6 years ago

Probably you're talking about different Symfony 3.4: Symfony SE vs Symfony Flex?

althaus commented 6 years ago

I'm using "classic" Symfony.

@chteuchteu Does a debug:container list the templating service?

quentin-st commented 6 years ago

Symfony SE here - running php bin/console debug:container templating outputs this:

 Select one of the following services to display its information:
  [0] templating.helper.logout_url
  [1] templating.helper.security
 > 
althaus commented 6 years ago

Something must be missing in your setup:

$ php bin/console debug:container templating

 // This service is an alias for the service templating.engine.twig

Information for Service "templating.engine.twig"
================================================

 ---------------- --------------------------------------
  Option           Value
 ---------------- --------------------------------------
  Service ID       templating.engine.twig
  Class            Symfony\Bundle\TwigBundle\TwigEngine
  Tags             -
  Public           no
  Synthetic        no
  Lazy             no
  Shared           yes
  Abstract         no
  Autowired        no
  Autoconfigured   no
 ---------------- --------------------------------------

Have you checked the deps in your composer file?

quentin-st commented 6 years ago

Yes indeed, I don't know what though

Here are my dependencies:

    "require": {
        "php": ">=7.1",
        "cocur/slugify": "^3.0",
        "doctrine/doctrine-bundle": "^1.6",
        "doctrine/orm": "^2.5",
        "incenteev/composer-parameter-handler": "^2.0",
        "presta/sitemap-bundle": "^1.5",
        "sensio/distribution-bundle": "^5.0.19",
        "sensio/framework-extra-bundle": "^5.0.0",
        "symfony/monolog-bundle": "^3.1.0",
        "symfony/polyfill-apcu": "^1.0",
        "symfony/swiftmailer-bundle": "^2.6.4",
        "symfony/symfony": "3.4.*",
        "twig/twig": "^1.0||^2.0"
    },
    "require-dev": {
        "sensio/generator-bundle": "^3.0",
        "phpunit/phpunit": "^6.0",
        "symfony/phpunit-bridge": "^3.0"
    },

Am I missing something?

quentin-st commented 6 years ago

Steps to reproduce:

symfony new wob 3.4 && cd wob
composer require whiteoctober/breadcrumbs-bundle
vim app/AppKernel.php # add "new WhiteOctober\BreadcrumbsBundle\WhiteOctoberBreadcrumbsBundle(),"
vim app/config/config.yml # add "white_october_breadcrumbs: ~"

php bin/console cache:clear

Here's the output:

In CheckExceptionOnInvalidReferenceBehaviorPass.php line 32:

  The service "white_october_breadcrumbs.helper" has a dependency on a non-existent  
   service "templating".
sampart commented 6 years ago

PR #84 might help here?

ngocdb commented 6 years ago

Set templating in config/packages/framework.yaml then no more errors for me.

framework:
    templating: { engines: [twig] }