Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When I try and clear my cache I get this error. But the module is working find on the website
/var/www/html# drupal cache:rebuild all
TypeError: Argument 1 passed to Drupal\metatag\Command\GenerateTagCommand::__construct() must be an instance of Drupal\metatag\MetatagManager, none given in /var/www/html/modules/contrib/metatag/src/Command/GenerateTagCommand.php on line 70 #0 [internal function]: Drupal\metatag\Command\GenerateTagCommand->__construct()
#1 phar:///usr/local/bin/drupal/src/Helper/CommandDiscoveryHelper.php(282): ReflectionClass->newInstance()
#2 phar:///usr/local/bin/drupal/src/Helper/CommandDiscoveryHelper.php(220): Drupal\Console\Helper\CommandDiscoveryHelper->validateCommand('Drupal\\metatag\\...', 'metatag', 'module')
#3 phar:///usr/local/bin/drupal/src/Helper/CommandDiscoveryHelper.php(159): Drupal\Console\Helper\CommandDiscoveryHelper->extractCommands('/var/www/html/m...', 'metatag', 'module')
#4 phar:///usr/local/bin/drupal/src/Helper/CommandDiscoveryHelper.php(117): Drupal\Console\Helper\CommandDiscoveryHelper->discoverCommands(Array)
#5 phar:///usr/local/bin/drupal/src/Helper/CommandDiscoveryHelper.php(75): Drupal\Console\Helper\CommandDiscoveryHelper->getCustomCommands()
#6 phar:///usr/local/bin/drupal/src/Application.php(312): Drupal\Console\Helper\CommandDiscoveryHelper->getCommands()
#7 phar:///usr/local/bin/drupal/src/Application.php(245): Drupal\Console\Application->prepare(Object(Drupal\Console\Helper\DrupalHelper), 'cache:rebuild')
#8 phar:///usr/local/bin/drupal/vendor/symfony/console/Application.php(123): Drupal\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Drupal\Console\Style\DrupalStyle))
#9 phar:///usr/local/bin/drupal/bin/drupal.php(115): Symfony\Component\Console\Application->run()
#10 phar:///usr/local/bin/drupal/bin/drupal(3): require('phar:///usr/loc...')
#11 /usr/local/bin/drupal(10): require('phar:///usr/loc...')
#12 {main}
TypeError: Argument 1 passed to Drupal\metatag\Command\GenerateTagCommand::__construct() must be an instance of Drupal\metatag\MetatagManager, none given in Drupal\metatag\Command\GenerateTagCommand->__construct() (line 70 of /var/www/html/modules/contrib/metatag/src/Command/GenerateTagCommand.php).
Comments
Comment #2
Purencool CreditAttribution: Purencool as a volunteer commentedComment #3
OllaanKoodeis CreditAttribution: OllaanKoodeis commentedI confirm this, I'm getting the same error. Drupal console not working anymore after updating Metatag to 8.x-1.0-beta11.
Comment #4
carletexTry updating to the latest version of the Drupal console.
It wasn't working for me either, and now with the Drupal console 1.0.0-rc9 works fine.
Comment #5
DamienMcKennaComment #6
DamienMcKennaThis level of a bug is critical.
Comment #7
DamienMcKennaThis appears to be caused by an out-of-date install of DrupalConsole, please update to the latest (rc11 at the time of writing) and it should work.
Comment #8
Purencool CreditAttribution: Purencool as a volunteer commentedThis worked for me
Comment #9
DamienMcKennaMarking this as being fixed, it appears to just happen because DrupalConsole needs to be updated.