Using Safe Mode to troubleshoot issues with themes and plugins

:bookmark: This guide explains how to use Discourse’s Safe Mode to troubleshoot issues with themes and plugins.

:person_raising_hand: Required user level: All users

Discourse offers a “JavaScript Safe Mode” that allows any user to isolate the root cause of JavaScript issues caused by plugins, themes, or theme components. This feature is particularly useful for troubleshooting problems on your Discourse site.

Accessing Safe Mode

To access Safe Mode, follow these steps:

  1. Open a new browser tab.

  2. Enter the following URL in the address bar, replacing [your-site-name](http://discourse.example.com) with your actual Discourse site domain:

    http://discourse.example.com/safe-mode
    

    For example, the Safe Mode URL for the Discourse demo site is:
    https://try.discourse.org/safe-mode

  3. Click the ‘Enter Safe Mode’ button:

Safe Mode options

When entering Safe Mode, you can select from the following options:

  • Disable themes and theme components
  • Disable unofficial client-side plugin customizations
  • Disable all client-side plugin customizations
  • Make Javascript deprecations raise an error

By default, the first three options are selected. The deprecation errors option is unchecked by default, and is primarily useful for plugin and theme developers testing compatibility with upcoming Discourse updates. You can enter Safe Mode multiple times with different combinations to isolate the specific component causing issues on your site.

Using Safe Mode

  1. Select the desired options on the Safe Mode page.
  2. Click “Enter Safe Mode” to apply your selections.
  3. You will see a banner indicating that Safe Mode is enabled.
  4. Browse your site to check if the issue persists with the selected components disabled.

Exiting Safe Mode

To exit Safe Mode, simply close your browser tab.

Important notes

When sharing a Safe Mode link for your 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.

:warning: Safe Mode currently only disables the JavaScript portions of plugins. To disable the server-side portion of a plugin, you must rebuild your container with the plugin commented out.

Troubleshooting

If you cannot load the initial Safe Mode selection page, try visiting the following URL, which will skip the page and load Safe Mode directly:

https://discourse.example.com/?safe_mode=no_themes,no_plugins

For example: https://try.discourse.org/?safe_mode=no_themes,no_plugins

The available safe_mode query parameter values are: no_themes, no_unofficial_plugins, no_plugins, and deprecation_errors. These can be combined with commas.

Last edited by @hugh 2024-07-30T05:32:08Z

Check documentPerform check on document:
73개의 좋아요
Admin Plugin page is blank - Error: There is no route named adminPlugins.index
502 and then empty forum after `./launcher rebuild app`
Upgraded last night and login button no longer works
Content of messages not showing up
Topic Preview Broken (due to Google PageSpeed Module)
"About" pages crashing our Discourse
Uncaught Errors
Manually Clear DistributedCache
Browser too old message when "compatibility mode" is forced in IE 11
Admin Plugin page is blank - Error: There is no route named adminPlugins.index
My site just broke after restarting server
After Recent Upgrade to 1.08? beta - No forum shows
Blank topics after import?
Problems clicking topic links in IE11
Website looks different on different browsers
How to disable a component without access to site?
Cannot create new topics (already disabled plugins)
How to increase site speed
Disable plugins without restarting?
A "safe mode" to easily disable all third party plugins
Beginner's guide to using Discourse Themes
Global notice doesn’t show
Incorrect initial order when user sorts topic list
Unable to expand profile
Disable plugin without downtime?
Mobile Header expanding after tapping hamburger menu
Discourse 2.3.0.beta10 Release Notes
Lightbox not showing up on uploaded images after update
Vimeo onebox not working
Pasting tables from spreadsheets no longer working after 2.3 upgrade
Contains_dtoc in Grey Amber theme header
Site fails to load with js errors
No content displayed on front category page after upgrade
Notifications are acting strange
Occasional page loads with no post content due to plugins
Discourse 2.5.0.beta2 Release Notes
LDAP Setup for Discourse
Unable to add/edit tags
Category unlike any other category
Unable to save wiki update
Infinite scroll not working in "Latest" on Mobile
Disappearing posts in 2.1.0.beta2
Post content not showing up
In-post links to topics - no longer update to the initial posts title
Issue with menu, admin
Excerpts truncating at 50 characters
How to change default Discourse theme via CLI?
Mentions reported wrongly as replies in notifications list
Bad JS customizations - how to fix in the backend?
Send Invites button should not be visible if local logins are disabled
Topic-footer buttons are disappearing
Blank pages, 500 errors and no logs
[2.1.0b6] New topic button is moving behind burger on click
Google, Twitter and Facebook Logins not working due to ad blocker
Can't See Posts When Logged Out
After latest admin/upgrade my Admin dashboard won't load
My install was broken because I upgraded but did not upgrade plugins
Bulk edit icon not showing?
Quoting is not working anymore
Some user see a blank page when opening a topic
Admin Trouble Creating a Category
Browser Back Button issue
Topic mismatch troubleshooting
Edit icon not activating after edits
I don't see the staff wrench on posts
Forum does not work for users on iOS
Category autocomplete stopped working on our site?
UI not loading after git pull update
Gui for querying category of solved or unsolved topics
Image displayed incorrectly on Mobile due to theme settings
Preview of post not loading because force https was not set
Reordering Categories Produces Error 422
Limit on Number of Child Categories?
Issue in user summary
Lightbox for images comes by default?
Having an issue with images' width getting cut off on desktop
Issue with the page title in Arabic?
Latest update broke my forum
Registration modal/popup not showing up for private instance
Iframes Not Working
Discourse unresponsive in Chrome
Topics tagged with `info` have strange appearance
Logins redirects to missing notifications page
Discourse broken after upgrade
Topic Will Close A Few Seconds After The Last Reply
Issues with index page infinite scrolling?
How might we better structure #howto?
Hashtags with numbers in parentheses appearing everywhere on Discourse site
After updating to 2.8.0.beta8, nothing shows as "read" anymore
Breaking Mobile view check after Discourse update to 2.5.0.beta7
Dashboard empty since upgradeto 2.5.0
Can’t create new category
Login form missing entirely from Discourse instance
Blank website after update
Content won't load after update
Category link failed after updating today
Error 500 on category page and homepage after upgrade to 2.6
Mouse click is not working in my forum after recent update
Screen black out bug on modal
Social share components do not appear
Admin panel does not work
Totally blank upgrades page
Accidentally overwrote application.hbs || Enter safe mode
Latest beta update (2.7.0b7) gone wrong
Some topic category boxes are missing
Need help reverting forums. I made a mistake
Pups::ExecError: su postgres -c 'psql discourse -c "alter schema public owner to discourse;"' failed with return
Can not access Discourse - blank page
Site broken after update
The "Save Changes" button is very low on my user preferences interface page
Phantom signups (two users with the same account after migration)
Homepage (sub)category display - lots of whitespace
Category Image Formatting
Update problem help pls
Bug on topic interface after an update || Resolved
Scroll jank when scrolling up
504 Gateway Timeout for some reports
Trust level 1 users cannot Invite
Error: Something went wrong - "Error while processing route: discovery.categories"
Loading groups gives internal server error
UI not rendering in Chrome/Firefox due to CloudFlare rocket loader
Private Message Can't Be Reached with private messaging disabled
How many category moderators are shown on about page?
What on earth is causing this?
While loading a new component on the site, the site is down
IP Lookup UI is broken
My forum is stuck on the loading screen
Safe-mode failed with a plugin
After upgrading to discourse 3.. can only access to admin using safe-mode
BBCode `url` tags break if wrapped text ends in URL with component after host
Fedoras Discourse instance made some troubles. Could the support please give some feedback
Minimizing Maintenance on Theme Customizations
Hide topic timeline
Forum stuck on the loading home screen
MacOs users on old version can´t read posts
Easy Responsive Footer Plug-in bug issues
Inline formatting used when "preformatted text" formatting applied to multi-line selection
Moving the server
Entire site is a blank page after upgrade
Collapse Button Not Working on Profile Page (Mobile)
Discourse forum wont load any pages whatsoever
`white-space` CSS property of clipboard data not respected when pasting in rich text editor
Discourse broken after moving servers
Dragging highlighted texts causes Chrome freeze
Client-side vs. server-side?
Client-side vs. server-side?
While loading a new component on the site, the site is down
Can't get Ruby to update so ./launcher rebuild app keeps failing
Base_path not being substituted in some cases
Edit CSS/HTML of custom theme not appearing
Finding Discourse RSS feeds
500 Error when posting, moment.tz runtime error
Some DMs are not visible
Air Theme Latest Update - Crash
Dashboard New Posts statistics broken
The order of characters when typing in the floating search widget is reversed
Made some changes I cannot revert
I'm getting errors when I switch categories too quickly
Inline “preformatted text” formatting used when multi-line selection doesn't contain hard break
Coincidental Markdown in formatted content pasted to rich text editor rendered on publish
Category settings broken
Spurious notification when navigating away from review queue after adding note
Links produced by the Composer link modal break when they contain a ' (%27)
TypeError when submitting a flag with custom content (require_message flags)
OpenClaw plugin for Discourse integration
Case study of an amateur plugin author
500 error on category view mobile due to knowledge base plugin
A topic doesn't open with recent upgrade due to a plugin
Only loading HEAD after upgrading docker, due to Babble plugin
Category Icons
Server errors in 2.5.0.beta3
Weird Formatting Bug in old Microsoft Edge
Topic replies are not displaying in chronological order?
My Discourse site is not loading due to misconfigured CSP
Missing scroll bar slider, in Finnish Localization
Category link failed after updating today
Discourse and Uncaught ReferenceError: ClipboardJS is not defined
Floating search box cannot be closed when device goes from horizontal to vertical
Using Cloudflare for HTTPS, empty preview pane in edit page
Writing an effective bug report
Avatar settings not visible with SSO
Emoticon button not working anymore (because of babble plugin)
Stable broken due to discourse-spoiler-alert
How to disable a plugin when admin plugin page is not loading
New topic and reply not working
Front page of discourse missing content
Messaging drop down menu not working
The composer needs to be more friendly to iPad Mini

어떤 이유인지 모르겠지만, 저에게는 이 링크들이 새 탭이나 창에서 열었을 때만 작동합니다. 첫 번째 링크는 오류 페이지로, 두 번째 링크는 홈 페이지로 연결됩니다. 하지만 안전 모드 배너는 표시되지 않습니다. 두 번째 링크는 안전 모드를 사용해 보라고 사용자에게 링크를 보낼 때 문제를 일으킬 수 있습니다. 사용자가 단순히 링크를 클릭하면 안전 모드 없이 사이트를 계속 사용하게 됩니다.

아마 이 정보가 #how-to에 추가되어야 할 것 같습니다.

4개의 좋아요

잘 짚어냈어요. 두 링크 모두 깨져 있네요. 첫 번째 링크에는 물음표가 필요하고, 두 번째 링크에는 %2C 대신 쉼표가 필요합니다.

2개의 좋아요

어디에 "?"가 필요한가요?
예시로 링크를 공유해 주시겠어요?

1개의 좋아요

아, 죄송합니다. 첫 번째는 제가 오판한 것 같습니다. 내부 내비게이션은 실패하지만, 새 창에서는 정상적으로 작동합니다.
Discourse Meta

두 번째도 제가 틀렸습니다! Discourse Meta - The Official Support Forum for Discourse
은 동일 페이지 내비게이션으로 작동하지 않습니다.

제 실수였습니다. 무언가 깨져 있긴 하지만, URL의 문제는 아닙니다.

1개의 좋아요

원래 위치에 그대로 열려고 하기 때문인 것 같아요. 굳이 따지고 싶지 않아서 try.discourse.org로 교체해 두었습니다. :slight_smile:

2개의 좋아요

어떻게든 관리자분들께도 이러한 링크 공유가 쉽게 문제가 될 수 있다는 점을 알리는 것이 필요하다고 생각합니다.

예를 들어, 메타에서 문제를 보고한다고 가정해 보겠습니다. "https://meta.discourse.org/safe-mode를 시도해 보시겠습니까?"라고 물을 수 있습니다. 그러면 저는 해당 링크가 작동하지 않는다고 답할 것입니다.
아니면 더 나쁜 경우: 테마만 비활성화하라고 지시하고 싶어서 https://meta.discourse.org/?safe_mode=no_themes를 시도해 보라고 할 수 있습니다. 제 문제는 여전히 존재합니다. 제가 정말로 세이프 모드를 사용했는지 어떻게 확신할 수 있습니까? 사용자로서는 링크를 클릭했을 때 뭔가 반응이 있었기 때문에 작동한다고 생각했습니다.

여기에 게시물을 올린 후에야 이 사실을 알게 됩니다. 하지만 다른 관리자분들은 이것이 문제가 될 수 있으니 주의해야 한다는 것을 어떻게 알 수 있을까요?

3개의 좋아요

이 안전 모드 페이지가 모든 콘텐츠를 대체하는 방식으로 표시되는 점을 고려할 때, 이 링크를 새 탭에서 열도록 예외를 두어야 하는지 궁금합니다.

2개의 좋아요

주석과 함께 ‘성공한’ 화면 캡처도 추가했습니다. 어때요?

4개의 좋아요

3개의 게시물이 새 주제 비스태프 사용자의 경우 안전 모드를 기본적으로 꺼야 하는가?로 분리되었습니다.