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

purencool created an issue. See original summary.

Purencool’s picture

Issue summary: View changes
OllaanKoodeis’s picture

I confirm this, I'm getting the same error. Drupal console not working anymore after updating Metatag to 8.x-1.0-beta11.

carletex’s picture

Try 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.

DamienMcKenna’s picture

DamienMcKenna’s picture

Title: ypeError: Argument 1 passed to Drupal\metatag\Command\GenerateTagCommand » TypeError: Argument 1 passed to Drupal\metatag\Command\GenerateTagCommand
Priority: Normal » Critical

This level of a bug is critical.

DamienMcKenna’s picture

Priority: Critical » Normal
Status: Active » Postponed (maintainer needs more info)

This 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.

Purencool’s picture

This worked for me

DamienMcKenna’s picture

Status: Postponed (maintainer needs more info) » Fixed

Marking this as being fixed, it appears to just happen because DrupalConsole needs to be updated.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.