Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException: The entity type did not specify a "x" form class.

This error comes across when an entity form is requested, but is not available in the form handlers of that entity. 

Solution

Make sure the key and form namespace is added to the handlers of your modules/custom/myEntity/src/Entity/myentity.php

 *   handlers = {
 *     "access" = "Drupal\offer\OfferAccessControlHandler",
 *     "views_data" = "Drupal\offer\OfferViewsData",
 *     "form" = {
 *       "default" = "Drupal\offer\Form\OfferForm",
 *       "step_1" = "Drupal\offer\Form\OfferAddFormStep1",
 *       "step2" = "Drupal\offer\Form\OfferAddFormStep2",
*     .....

 

 

Saved you some valuable time?

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