Score:-2

MInified CSS file isn't loaded on a page where I have a webform with the "file upload" component

cn flag

I added a webform with the Upload file component on a page.
When I visit that page without minifying CSS files, everything works fine; when CSS files are minified, this page doesn't load them, the page seems a WSOD. The other pages work fine.

When I remove the Upload file component, everything works fine.

Score:1
in flag

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.
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.