Warning: Failed to open bootstrap.min.css and bootstrap.bundle.min.js

Created on 12 September 2024, 2 months ago

I've added SASS starter kit and set 'Local' for loading library, then I get following errors to the front page.

Warning
file_get_contents(libraries/bootstrap/dist/css/bootstrap.min.cc): Failed to open stream: No such file or directory in
Drupal\Core\Asset\CssCollectionOptimizerLazy->generateHash()
(lin 43 of core/lib/Drupal/Core/Asset/AssetGroup/SelfHashTrait.php).

I initially thought this is anything to do with theme's calling libaries, so I added below line to mytheme.libraries.yml

css:
component:
css/bootstrap.min.css: {}
css/style.css: {}

The last line was already present beforehand.

I still have the same error, and sometimes I have similar error for boostrap.bundle.min.js file.

I did install all dependencies coming with gulp, but I might have missed something.

πŸ’¬ Support request
Status

Active

Version

5.5

Component

Code

Created by

πŸ‡°πŸ‡·South Korea keithkhl

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @keithkhl
  • πŸ‡°πŸ‡·South Korea keithkhl

    Because I have removed SASS starter kit, after I created my own custom sub-theme.
    Once I install the theme again, the issue is gone.

  • πŸ‡ΊπŸ‡ΈUnited States derekw

    Did you add the library copy command to your composer.json? This was working for me until today, but no longer is doing the copy (on Pantheon).

    See Bootstrap Libraries Load section.
    Bario Bootstrap 5 Theme β†’

    "scripts": {
            "pre-update-cmd": ["DrupalComposerManaged\\ComposerScripts::preUpdate"],        
            "post-update-cmd": [
                "@composer drupal:scaffold",
                "mkdir -p web/libraries/bootstrap",
                "cp -R vendor/twbs/bootstrap/dist web/libraries/bootstrap",
                "DrupalComposerManaged\\ComposerScripts::postUpdate"
            ]
        },

    The files exist in vendor/twbs/bootstrap but they are not being copied to web/libraries/bootstrap, so they can't be found.

Production build 0.71.5 2024