Drupal\Component\Plugin\Exception\PluginException: Plugin (footer_block) instance class "Drupal\my_module\Plugin\Block\footer_block" does not exist.

This error probably occurs when you try to add a custom block to a region.

When you get this error, you probably made a typo in your namespace. Namespace should be:

namespace Drupal\my_module\Plugin\Block;

If you moved your code around too much, this can help:

In local.settings.php add:

$settings['class_loader_auto_detect'] = FALSE;

 

Saved you some valuable time?

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