I built a module on a local instance in my module/custom directory; I then published it on drupal.org, as Group by Field Widget. For some reason, when I install the release 1.1.1 via Composer, I get this error.
Warning: include(/app/web/modules/custom/group_by_field_widget/src/Plugin/Field/FieldWidget/EntityReferenceGroupByFieldWidget.php): failed to open stream: No such file or directory in /app/vendor/composer/ClassLoader.php on line 444
Warning: include(): Failed opening '/app/web/modules/custom/group_by_field_widget/src/Plugin/Field/FieldWidget/EntityReferenceGroupByFieldWidget.php' for inclusion (include_path='/app/vendor/pear/pear_exception:/app/vendor/pear/console_getopt:/app/vendor/pear/pear-core-minimal/src:/app/vendor/pear/archive_tar:.:/usr/local/lib/php') in /app/vendor/composer/ClassLoader.php on line 444
Drupal\Component\Plugin\Exception\PluginException: Plugin (entity_reference_group_by_field_widget) instance class "Drupal\group_by_field_widget\Plugin\Field\FieldWidget\EntityReferenceGroupByFieldWidget" does not exist. in Drupal\Component\Plugin\Factory\DefaultFactory::getPluginClass() (line 97 of core/lib/Drupal/Component/Plugin/Factory/DefaultFactory.php).
The module is installed in the module/contrib directory via Composer, but the warning states that /app/vendor/composer/ClassLoader.php is loading files from /app/web/modules/custom/.
Please note the error only appears when editing the manage form display page.
When I move the module into the custom directory it works fine. What would tie a module to a directory?