Score:0

A specified library is missing

tr flag

On a custom theme "foobar" (based on Olivero) this error message occured. This custom theme is a copy of drupals 9.2.2 olivero's theme.

Drupal\Core\Asset\Exception\InvalidLibrariesExtendSpecificationException: The specified library "foobar/cke-dialog" does not exist. in Drupal\Core\Asset\LibraryDiscoveryCollector->applyLibrariesExtend() (line 154 of core/lib/Drupal/Core/Asset/LibraryDiscoveryCollector.php).

My custom theme lives in web/themes/custom/foobar in foobar.libraries.yml I have defined the library:

cke-dialog:
  css:
    component:
      css/components/cke-dialog.css: {}

I did cleared all cache and the path to the library is correct.

I don't see what I'm missing here

cn flag
If the YML is verbatim you have an indentation error (`component` needs another space before it), but that's probably not causing that error as you'd expect to see an actual YML validation error. Other than that, if the theme is installed/enabled, the paths and filenames are all right, and you've rebuilt Drupal's cache, everything else looks correct
Joehoe avatar
tr flag
It wasn't an indentation error in my `libaries.yml` It appeared that a custom module can't have the same machine name as a custom theme. I figured this out, by uninstalling a custom module (with the same name) and reinstalled the theme.
Score:1
tr flag

If you run into this error after installing a custom theme:

The specified library "foobar/foobar" does not exist.

"Drupal\Core\Asset\Exception\InvalidLibrariesExtendSpecificationException: The specified library "foobar/cke-dialog" does not exist. in Drupal\Core\Asset\LibraryDiscoveryCollector->applyLibrariesExtend() (line 154 of core/lib/Drupal/Core/Asset/LibraryDiscoveryCollector.php)."

You might have a custom module enabled with the same machinename

Solution:

  1. uninstall custom theme/module
  2. Rename the machinename of custom theme/module
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.