8 – MInified CSS file isn’t loaded on a page where I have a webform with the “file upload” component

I’ve run into a similar situation (though I can’t remember if it was for all pages or a subset of pages). For me, the issue was with one css include in my custom theme. (I think my issue might have been that the css file was a mix of minified and unminified css – I don’t know why that was the case – but I never got to the bottom of it.)

My workaround solution was to prevent the one css file from being aggregated. To do this, you can set preprocess: false for the css file. See the Library options and details documentation on d.o.

My library ended up looking something like:

my_library:
  css:
    theme:
      assets/css/app.css: { preprocess: false }
      assets/css/theme.css: { }
  js:
    'assets/js/app.js': { }
    'assets/js/theme.js': { }
  dependencies:
    - core/jquery

which allows all of my theme’s files to be aggregated except for app.css.


To debug this issue, I did roughly the following:

  1. Tested with a different theme, e.g. bartik or your base theme (to determine where the issue is)
  2. Once I verified that my theme was the issue, I first excluded all items from aggregation (using preprocess: false).
  3. Once I verified that pages loaded fine with none of my theme’s files aggregated, I re-enabled aggregation for them one by one.