PHP Fatal error: Uncaught Error: Call to undefined method Drupal\Core\DrupalKernel::prepareLegacyRequest() in drupal/console/src/Utils/DrupalApi.php:266

Encountering this error on drupal 9 sites.

Remove this code at line vendor/drupal/console/src/Utils/DrupalApi.php:266

$kernel->prepareLegacyRequest($request);

Source: https://github.com/hechoendrupal/drupal-console/issues/4261#issuecomment-710758596

 

Saved you some valuable time?

Buy me a drink 🍺 to keep me motivated to create free content like this!