1

I'm working on a small D8 site. When turning the option "Aggregate CSS files" (admin/config/development/performance) on localhost, everything works fine. However, doing so when on my test server completely breaks the site presentation, both on the front (public pages) and back-end (admin).

It appears that when this option is on, the URL for the aggregated CSS is incomplete: the filename is not present, as well as most of the path, actually. Which means I have something like:

<link rel="stylesheet" href="/dpfolder/?okfo8d" media="all" />
<link rel="stylesheet" href="/dpfolder/?okfo8d" media="all" />

(the site lives in "dpfolder", although it's temporary.)

This happens with both the admin theme (seven) and the public theme (a custom theme based on Classy).

And it only happens when the option "aggregate" is ON. When it's OFF, everything displays fine (but then the CSS files are included via @import rules in a style element, and not via a link element like above).

Any idea what's causing this?

  • 1
    Not sure but if i guess you can check folder permission and public media directory set up. – DRUPWAY Jan 27 '17 at 12:38
2

As a comment suggested, sounds like your server does not have a writable files folder. That folder should and is by default excluded from git, you need to create it and make sure that the apache user (or whatever user the processes run as) has write permissions to that.

  • Thanks. I think that's already the case... But I'll check again next week. – s427 Jan 27 '17 at 19:46
  • I have added the 775 permission to the default folder still css not working in Aggregate mode ON – Manmeet Khurana Aug 28 '18 at 10:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.