My Discourse site is not loading due to misconfigured CSP

AI-generated summary

The discussion revolves around an issue with a Discourse site not loading properly on Safari 14, particularly in Invisible Mode. Jamie_Liu1 initially reported the issue, providing screenshots of the site’s rendering in normal and Invisible Mode. codinghorror suggested trying Discourse Safe Mode, but Jamie_Liu1 reported that it didn’t work.

Falco asked for the browser error console logs, and NoahGreat confirmed the issue, suspecting a problem with Safari 14’s update. However, pmusaraj reported that the site loaded fine on Safari 14 for them.

Wojtekxtx found that the issue wasn’t limited to Safari 14, as it also occurred on Brave. Finally, Falco identified the root cause as a misconfigured Content Security Policy (CSP), which blocked the loading of a resource. The error message indicated that the page’s settings blocked the loading of a script due to a “script-src” issue.

Hi there, I just upgraded my Safari browser to 14 and found that our forum doesn’t load fully on Safari 14 (Invisible Mode).

Here is how the forum renders on the normal version of Safari 14:

And here is how it looks on Safari 14 in Invisible Mode:

The forum doesn’t work well ounder either the normal mode or the Invisible mode on Safari 14 according to one of my coworkers.

Can someone explain why this happens?

Here is the link to our forum in case you need it for debugging: https://discuss.nebula-graph.com.cn/

Thanks in advance!

Have you tried in Discourse Safe Mode? Have you tried in a different web browser?`

Just tried Discourse Safe Mode. Didn’t work, either, See the screenshot below:

It is now totally blank because all plugins and customization have been disabled.

Other browsers work fine. Only Sarafi 14 has this issue.

Check the browser error console, and paste the error message here.

Opened it now and have the same issue
Looks like Safari 14 updated smth and broke everything…

Your site loads fine for me on Safari 14, tested it both on macOS and iOS.

Did you try the invisible mode?

Yes, works fine in a private iOS Safari window.

@Jamie_Liu1 indeed, there is a problem, but not only with Safari 14, but Brave also.

You have a misconfigured CSP.

Content Security Policy: The page’s settings blocked the loading of a resource at https://discuss.nebula-graph.com.cn/brotli_asset/application-162a118d174ff0a09cdf2b536ac3ec1d0c0c50256a981d045ffdf5f73e3e94ba.js (“script-src”).