Skip to content

Cannot autowire service Http\HttplugBundle\Collector\Formatter #210

@soullivaneuh

Description

@soullivaneuh
Q A
Bug? yes
New Feature? no
Version v1.7.1

Actual Behavior

I have the following error with no-debug env:

  [Symfony\Component\DependencyInjection\Exception\AutowiringFailedException]                                                                                                                                                                 
  Cannot autowire service "Http\HttplugBundle\Collector\Formatter": argument "$formatter" of method "__construct()" references interface "Http\Message\Formatter" but no such service exists.                                                 
  Cannot autowire service "httplug.factory.docker": argument "$formatter" of method "Http\HttplugBundle\Collector\ProfileClientFactory::__construct()" references class "Http\HttplugBundle\Collector\Formatter" but no such service exists.  

Expected Behavior

No error and service building like it works with debug setting.

Steps to Reproduce

Define the following services:

services:
  httplug.factory.docker:
    class: Http\HttplugBundle\Collector\ProfileClientFactory
    arguments:
      $factory: [ Docker\DockerClient, 'createFromEnv' ]
  Docker\Docker:
    arguments:
      $httpClient: '@httplug.client.docker'

And run:

./bin/console cache:clear --env=prod

Possible Solutions

See #210 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions