Knowledge.ToString()

Drupal 8 – Css/JavaScript Files not Loading for New Installation

If you have installed Drupal 8 on Windows server and noticed the plain html website without Css/JavaScript, here is a way to fix the issue.

  1. Go to plain html website. You will still be able to navigate to the website. Look for Administration > Configuration > Performance link.
  2. Click on this link to open up a page which shows “Bandwidth Optimization” section. Unselect “Aggregate CSS files” and “Aggregate JavaScript files”. Click on “Save Configuration” button.
  3. At this moment, you would get your site with Css and JavaScript but the main problem is not solved yet. So follow the next steps.
  4. Go to DRUPAL_ROOT\sites\default\files folder. Create a folder “tmp” here so the final folder structure looks like DRUPAL_ROOT\sites\default\files\tmp.
  5. Now go back to Administration > Configuration > Development > Performance page
  6. Click on “Clear all caches” button.
  7. Now select “Aggregate CSS files” and “Aggregate JavaScript files”. Click on “Save Configuration” button.
  8. You should have got your Drupal website working with aggregated Css/JavaScript files.

Share

Comments

4 responses to “Drupal 8 – Css/JavaScript Files not Loading for New Installation”

  1. lalo Avatar
    lalo

    thanks i spent a week trying to figure this out

  2. James Avatar
    James

    Your simple solution just saved me after 3 hours of almost pulling my hair out! Thanks!

  3. Graham Avatar
    Graham

    Hi. Problem is my development site (windows10, wamp), the production site (linux) works fine. Clearing the aggregate settings worked fine .. site working with css & script but as soon as I reset the aggregates – no css ! I can live with it but I’d to fix it .. any ideas (production site works fine) (and yes, I did create the tmp folder

  4. Senen Paez Avatar
    Senen Paez

    thanks for your help. does it happen only to d8 installed in windows server? mine is installed in linux, yet the same thing happen, i will try if it will work on linux. thanks for your instruction.

Leave a Reply

Your email address will not be published. Required fields are marked *