Example by hook (or by libraries.yml, no difference)

function HOOK_preprocess_html(&$variables) {
  $variables['page']['#attached']['library'][] = 'modules/lololo';
}

Result:

User warning: The following theme is missing from the file system: modules in drupal_get_filename() (line 233 of core/includes/bootstrap.inc).
drupal_get_filename('theme', 'modules') (Line: 256)
drupal_get_path('theme', 'modules') (Line: 390)
Drupal\Core\Asset\LibraryDiscoveryParser->drupalGetPath('theme', 'modules') (Line: 85)
...

Not 'theme', but 'library' problem.

Probably because there are not enough conditions in LibraryDiscoveryParser (line 79):

      if ($this->moduleHandler->moduleExists($extension)) {
        $extension_type = 'module';
      }
      else {
        $extension_type = 'theme';
      }

also, perhaps, we need to check the coincidence of names between different types. (see https://www.drupal.org/node/2732187)

Comments

Anonymous’s picture

vaplas created an issue. See original summary.

Anonymous’s picture

Issue summary: View changes
Anonymous’s picture

Anonymous’s picture