This error shows up when trying to generate a controller, module, form or whatever. The issue is, that console needs a uri to work with. Change your command from
drupal generate:controller
to
drupal generate:controller --uri=mysite.local