When I create a module and a custom service with drush generate and then create another service, also with drush generate, the first one is not available to inject.

What is missing to make it become available?

I'm on drupal 9.1 and drush 10.4.

The steps to reproduce

drush generate module

Given any name

dursh en test_module
drush cr
drush generate custom-service
drush cr

Given any name

drush generate custom-service

Answer dependecy injection with yes and try to find the name from the first service.

  • 1
    Maybe then module needs to be enabled? Or only core services can be injected? I'm gonna forward the question to Drush maintainers. – leymannx Feb 23 at 9:59
  • I already tested it with the module enabled, but had no luck. I tested with a generated service and the plugin manager from a generated plugin. It's a fresh installation on docksal. – uniquename Feb 23 at 13:18
  • Then I guess you probably need to add the code to the question to make it reproducible to tell if it's a bug or what may be wrong. – leymannx Feb 25 at 7:37
  • No cache flush between the first and the second service? – leymannx Feb 25 at 13:45
  • bwoy;-) yes edited this too. it's pretty much standard, thats why i'm wondering – uniquename Feb 25 at 18:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.