So I built a module on a local instance in my module/custom directory. I then published my module to drupal.org. For some reason when I install my module via composer on a new project 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 The website encountered an unexpected error. Please try again later. DrupalComponentPluginExceptionPluginException: Plugin (entity_reference_group_by_field_widget) instance class "Drupalgroup_by_field_widgetPluginFieldFieldWidgetEntityReferenceGroupByFieldWidget" does not exist. in DrupalComponentPluginFactoryDefaultFactory::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 /app/vendor/composer/ClassLoader.php is loading files from /app/web/modules/custom/.