Use Safe Mode to troubleshoot issues with themes and plugins

Discourse has a “JavaScript Safe Mode”, where any user can use to isolate the root cause of a JavaScript issue caused by plugins, themes or theme components.

To access safe mode go to:

http://your-site-name/safe-mode for example this is the safe mode for our demo site:

https://try.discourse.org/safe-mode

To exit safe mode simply close your browser tab

When entering safe mode you can select between:

  • Disable all themes and theme-components

  • Disable unofficial plugins

  • Disable all plugins

By default, all 3 options are selected, but you can enter safe mode multiple times to isolate the culprit breaking your site.

:information_source: If sharing your safe mode link on your own site, be aware that it needs to be opened in a new tab or added directly to the address bar otherwise it may not work correctly. eg https://meta.discourse.org/safe-mode

Safe mode currently only disables the JavaScript portions of plugins, to disable the server-side portion you must rebuild your container with the plugin commented out. Though historically the majority of breakages were in the JavaScript portions of plugins.

69 Likes

Somehow, for me those links only work when I open them in a new tab or window. The first one leads to the oops page and the second one to the homepage. But the safe-mode banner does not appear. The second one can lead to problems when you send a link to a user to let them try safe-mode. If they just click the link, they will still use the site without safe-mode.

Maybe this information should be added to the how-to.

3 Likes

Good catch -both links are borked. The first needs a ? and the second needs a comma instead of %2C

1 Like

Where does it need a “?”?
Could you share the link as an example?

Oh, sorry, it looks like I’m wrong on the first one: the internal navigation fails, but for a new window it works.
Discourse Meta

And I’m wrong on the other one too! Discourse Meta - The Official Support Forum for Discourse
doesn’t work as a same-page navigation.

My mistake: something is broken, but it’s not the URLs.

I think it’s because it’s trying to open them in place. Rather than argue with it I’ve swopped them out for try.discourse.org. :slight_smile:

1 Like

I think somehow admins should still be informed that sharing those links can easily be a problem.

For example, I report an issue on meta. You could ask, “Could you try https://meta.discourse.org/safe-mode?” Then I would tell you that the link does not work.
Or even worse: you want to specify that I disable only themes, so you ask me to try https://meta.discourse.org/?safe_mode=no_themes. My problem still exists. How are you sure I really used safe-mode? As a user, I think it worked because something happened when I clicked the link.

After I posted here, you know about this. But how do other admins know they have to pay attention that this could be a problem?

2 Likes

I’m wondering, due to the nature of this safe home page displayed (that replaces all the content), if an exception should be made to open this link to a new tab.

1 Like

I’ve added a note and also a screenshot of a ‘successful’ one. How does that look?