In my theme:

libraries-override:
  classy/base: false
  classy/user: false
  classy/dropbutton: false
  classy/dialog: false

In Classy:

libraries:
  - classy/base
  - core/normalize

libraries-extend:
  user/drupal.user:
    - classy/user
  core/drupal.dropbutton:
    - classy/dropbutton
  core/drupal.dialog:
    - classy/dialog

Results in:

Drupal\Core\Asset\Exception\InvalidLibrariesExtendSpecificationException: The specified library "classy/dialog" does not exist. in Drupal\Core\Asset\LibraryDiscoveryCollector->applyLibrariesExtend() (line 169 of /Users/jmburnz/Sites/contrib/drupal8/drupal/core/lib/Drupal/Core/Asset/LibraryDiscoveryCollector.php).

Perhaps this is a critical oversight in the design of the libraries override/extend system and in particular with regards to how Classy is using these systems. I want to use Classy for its templates, but I do not want the CSS it is adding - I am using my own and Classy adds a lot of style that I simply don't want. All I want to do is blow away all classy CSS files - how do I do this and avoid writing PHP and not get an exception?

CommentFileSizeAuthor
#23 2589601-nr-bot.txt150 bytesneeds-review-queue-bot

Issue fork drupal-2589601

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Jeff Burnz created an issue. See original summary.

Jeff Burnz’s picture

Issue summary: View changes
pwolanin’s picture

This doesn't look like it meets the criteria for critical: https://www.drupal.org/core/issue-priority

Jeff Burnz’s picture

Priority: Critical » Major

You're correct, stylesheets-remove works - there is an alternate workaround.

Wim Leers’s picture

I think this has been fixed since then. Please check/confirm.

Jeff Burnz’s picture

Wim, I think you're right, however I can run some tests later next week. Cheers.

Wim Leers’s picture

Thanks!

almaudoh’s picture

Is this still an issue, can we close it out?

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Salsero72’s picture

Hi,
for those who'll encounter this same problem and get a blank page here's what happened to me.
(the page was'nt really blank. i got an "Unexpected general error" (or something similar. Sorry i do not remember)

I was running Drupal 8.1.0

WHAT CAUSED THE ERROR:

Really I do not know. I installed Zircon D8, and it was not working. Then I disabled. Everything was ok.
Than did many other config things.
Then I cleared the cache and boom! the problem popped.
Truncating all cache tables with mysql client didn't work for me.

WHAT I DID:
I googled and found this only page. But I could not find any fix here.
So I went the heavy way. I edited

core/lib/Drupal/Core/Asset/LibraryDiscoveryCollector.php

at line where "protected function applyLibrariesExtend" is declared. (line 149 for me)
at the very first line I put:

  echo $library_name.'<br>';
  if($library_name == 'drupal.dialog'){return;}
   if($library_name == 'drupal.dropbutton'){return;}
   if($library_name == 'drupal.user'){return;}
   if($library_name == 'drupal.vertical-tabs'){return;}
   if($library_name == 'jquery.ui'){return;}

Well I started adding first line and with trial and error, added lines one by one.
The final result is as shown here above.

By doing this I could get a raw display of the front end and admin panel.
In that i went to
admin/config/development/performance

and cleared the cache by pressing the "empty cache" button.
After that I got back control of my site (normal full version)

Truncating cache tables or upgrading to 8.1.1 didn't solve the problem.

Hope this helps.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

pameeela’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)
Issue tags: +Bug Smash Initiative

Thanks for reporting this issue. We rely on issue reports like this one to resolve bugs and improve Drupal core.

As part of the Bug Smash Initiative, we are triaging issues that are marked "Postponed (maintainer needs more info)".

Since there were no specific steps to reproduce the issue provided since the issue was postponed, I'm marking the issue "Closed (cannot reproduce)". If anyone can provide complete steps to reproduce the issue (starting from "Install Drupal core"), document those steps in the issue summary and set the issue status back to "Active".

Thanks!

Driskell’s picture

Version: 8.9.x-dev » 9.2.x-dev
Status: Closed (cannot reproduce) » Active

I am able to reproduce this in Drupal 9.2.10.

Effectively the libraries overrides from the active theme are applied when the extension's libraries are loaded.
However, extends is applied afterwards.
This can mean that a libraries-extend definition can fail because the library listed to be added to the existing library, won't exist anymore due to it being completely removed by the libraries-override.

I hit this because there was a library in parent theme that was both attached in some places, and in others it was attached via libraries-extend of another existing library from another module.

I wanted to remove this and add my own in the child theme. But as soon as you override to false to remove it, the libraries-extend begins to fail in the parent theme because it cannot find the library.

The example in the OP should work too as that's the same process.

Driskell’s picture

MR 1617 is a possible way to fix but I'm unsure on the acceptability of changing library-overrides so it "empties" a library rather than removes it. Although emptying it does mean it's practically had its JS and CSS removed, but still exists so can be referenced by libraries-extend still without an exception being thrown and getting a WSOD, and can also still be referenced in code anywhere else as an empty library. Issues could arise in contributed code I guess if it relies on libraries-override removing a library completely.

Open to ideas on this. Anything else I think changes the design a little - such as the overrides need to account for extends or there needs to be memory of what was removed by overrides to suppress the exception. None seem clean or desirable TBH but I do think the issue should be fixed...

Driskell’s picture

Status: Active » Needs review
needs-review-queue-bot’s picture

Status: Needs review » Needs work
FileSize
150 bytes

The Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

Version: 9.2.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.