3

I have deployed my Drupal 8 website, but I don't get any CSS on it.

I deployed it on mydomain.com/newdrupal, maybe this needs extra configuring somewhere?

Screenshot

When I check my logs, I have about 20 messages with this warning:

Warning: file_put_contents(temporary://filedGJSiQ): failed to open stream: "Drupal\Core\StreamWrapper\TemporaryStream::stream_open" call failed in file_unmanaged_save_data() (line 888 of /var/www/stijnAerts/notify/core/includes/file.inc).

I also have this in my console:

Resource interpreted as Stylesheet but transferred with MIME type text/html: "*****/notify/?o66rbh".

Note: This is a base theme, so no custom theme.

5
  • Do you have any error messages on admin/reports/status? That is always the first place to look.
    – mpdonadio
    Apr 22, 2016 at 13:55
  • And a screendump of your network tab of the Developer Tools (or equivalent) would be helpful.
    – dmsmidt
    Apr 22, 2016 at 13:59
  • Dumb question: have you installed any custom theme on it?
    – Eyal
    Apr 23, 2016 at 20:33
  • Because this seems like one of the base themes in drupal core.
    – Eyal
    Apr 23, 2016 at 20:34
  • This is a base theme, so no custom theme. I have edited the OP with the error reports. Apr 25, 2016 at 10:28

4 Answers 4

1

Looks like something is wrong with your temp folder, such as:

  • When you moved my site to a different server the path to temp was changed and needs to be updated.
  • The permission of this folder are not set correctly.

Refer to these links for more inspiration:

2
  • Ok, I did this: change temp folder (at your-url/admin/config/media/file-system) to sites/default/files/temp It worked, thanks! Apr 25, 2016 at 11:56
  • 1
    Geweldig (oeps, for those who are not so good in Dutch/Flemish): formidable (grrrrr, that's French, 1 more try) ... Fantastic! Apr 25, 2016 at 12:00
1

In addition to @acrosman:

Make sure that your files and temporary files directories are writable by the server.

1
  • Files has 777 on it, where is temp files directory? I can't locate this anywhere Apr 25, 2016 at 10:33
1

Be sure to check the logs at /admin/reports/dblog . In some cases, permission errors will not be available at /admin/reports/status , but they do show up on the log.

In particular if you are getting unstyled pages, the paths to the aggregated CSS and JS files are broken, then check Drupal's internal log after clearing caches.

0

Check your browser's console for errors, and see if there is something obvious there causing it to fail.

If you're using a custom theme check to make sure you had the theme include the CSS files through its processing, not by hard-coding them into your twig files.

Also make sure you've rebuilt the caches after deploying if you copied over a database.

Check the status page to make sure you have write access to the correct parts of your file system.

5
  • 1
    If $settings['trusted_host_patterns'] was incorrect you would see a message that says "The provided host name is not valid for this server." and report it as a 500 error.
    – mpdonadio
    Apr 22, 2016 at 13:50
  • It may be a bug that's since been resolved, but I ran into a problem at one point on D8 that trusted_host_patterns error caused CSS and JS failure.
    – acrosman
    Apr 22, 2016 at 13:56
  • Rather odd (I wrote that feature), especially since JS and CSS bypass the Drupal bootstrap, except when aggregation is on for the first request from a cold cache.
    – mpdonadio
    Apr 22, 2016 at 16:25
  • Honestly, I didn't investigate deeply. I fixed host_settings, problem vanished, and I assumed a relationship. Totally possible I also kicked the cache at the same time or other similar update. I've updated the answer to remove the reference.
    – acrosman
    Apr 22, 2016 at 16:59
  • "Refused to execute script from '*******/notify/' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled." Is present in the console. No custom theme. Cache has been rebuild. Where is the status page? Apr 25, 2016 at 10:46

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.