Common causes for Discourse White Screen of Death

Similarly to the Apple iPhone White Screen of Death (WSoD), the White Screen of Death for Discourse refers to an error or issue with the website that causes the front and content pages to display only a white screen or no content.

There are several reasons for this, which will mention and refer to their solution in this post.

1. CDN and caching causes white screen

As you know, caching will speed up the performance of your website by caching static files. Caching static files may result in your website not having the newer versions of static files and may result in some form of JavaScript errors. You can find out by checking the browser console for JavaScript errors. Also, check if there are any CDN issues.

Solution.

To solve this, clear the server cache.

For more information about this, see CDN causes white screen - support - Discourse Meta.

2. Cloudflare Rocker Loader

Rocker Loader is an advanced caching feature offered by Cloudflare to speed up the paint time for a website, this may result in caching issues.

For more information about this, see CDN causes white screen - support - Discourse Meta.

Solution

Disable Cloudflare Rocket Loader.

See Cloudflare Rocket Loader Conflict | Mediavine Help Center. for more information on how to disable Rocket Loader.

Discourse refused to load with CSP policy error after rebuild

CSP stands for Content Security Policy. It is a HTTP response header that modern browsers use to enhance the security of resources for a website. CSP header restrict how resources such as JavaScript, CSS, or pretty much anything that the browser loads.

Discourse CPS setting might be blocker resources that your site needs.

Solution

Please note, I don’t recommend to use this method, but it’ s a good fix.

./launcher enter app
rails c

and then in the rails console

SiteSetting.content_security_policy = false

For more information about this, see Discourse refused to load with CSP policy error after rebuild - #4 by pmusaraj - support - Discourse Meta.