Problem/Motivation

When installing the theme, there are some warnings about files not existing.

The errors are as follows:
Warning: file_get_contents(core/../themes/contrib/eureka/components/03-organisms/item-list/latest-news/latest-news.min.css): Failed to open stream: No such file or directory in Drupal\Core\Asset\CssCollectionOptimizerLazy->generateHash() (line 43 of core/lib/Drupal/Core/Asset/AssetGroupSetHashTrait.php).

Warning: file_get_contents(core/../themes/contrib/eureka/components/02-molecules/card/news-card/card.min.js): Failed to open stream: No such file or directory in Drupal\Core\Asset\JsCollectionOptimizerLazy->generateHash() (line 43 of core/lib/Drupal/Core/Asset/AssetGroupSetHashTrait.php).

Steps to reproduce

Install the theme and see errors in dblog or shown on the page when logged in as admin.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork eureka-3577725

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:

Comments

nexusnovaz created an issue. See original summary.

velmir_taky made their first commit to this issue’s fork.

velmir_taky’s picture

Status: Active » Needs review

Root cause analysis:

The Eureka theme's build system (scripts/minify.cjs) generates .min.css from each .css source file and .min.js from each .js source file. Three SDC components have libraryOverrides entries referencing .min files that were never generated because the source files don't exist:

1. latest-news — declares libraryOverrides for latest-news.min.css, but this component has no CSS source file. It is a pure Twig wrapper ({% embed "eureka:item-list" %}) that relies entirely on the parent item-list component's styles. The libraryOverrides block was copy-pasted from a component that does have CSS (like staff-cards).

2. external-cards — same situation: declares libraryOverrides for external-cards.min.css with no CSS source. Also a pure Twig wrapper around item-list. (Not mentioned in the original report but same root cause.)

3. news-card — the CSS override (news-card.min.css) is correct, but the JS override references card.min.js. SDC resolves paths relative to the component's own directory, so it looks for news-card/card.min.js which doesn't exist. The actual file is in the parent card/ directory, and the JS is already loaded via {{ attach_library('eureka/card') }} in news-card.twig.

These warnings only appear when CSS/JS aggregation is enabled. Drupal core's AssetGroupSetHashTrait::generateHash() calls file_get_contents() without error suppression to compute content hashes, which triggers the PHP warnings for missing files.

Fix:

Remove the erroneous libraryOverrides entries:
- latest-news.component.yml — remove entire libraryOverrides block
- external-cards.component.yml — remove entire libraryOverrides block
- news-card.component.yml — remove only the js section from libraryOverrides (keep the valid CSS override)

nexusnovaz’s picture

Status: Needs review » Postponed (maintainer needs more info)

Thanks for the work. This is currently wip and im just awaiting some more information from the other maintainers to see the direction we wanted to take this in.

Many thanks!

psebborn’s picture

Status: Postponed (maintainer needs more info) » Active

Looks good to me - approved

velmir_taky’s picture

Status: Active » Needs review
psebborn’s picture

Status: Needs review » Reviewed & tested by the community

RTBC - all good!

nexusnovaz’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for the work all

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.