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 all themes and theme components
  • Disable unofficial plugins
  • Disable all plugins

By default, all three options are selected. However, 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

:information_source: On Discourse versions 2.9.0.beta8 and below, you need to use ?safe_mode=no_custom,no_plugins instead.

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

Check documentPerform check on document:
「いいね!」 73

なぜかこれらのリンクは新しいタブまたはウィンドウで開いた場合にのみ機能します。最初のリンクは「oops」ページに、2番目のリンクはホームページに移動します。しかし、セーフモードバナーは表示されません。2番目のリンクは、ユーザーにセーフモードを試してもらうためにリンクを送信した場合に問題を引き起こす可能性があります。ユーザーがリンクをクリックしても、セーフモードなしでサイトを使用し続けます。

この情報は#how-toに追加すべきかもしれません。

「いいね!」 4

よく見つけました。どちらのリンクも壊れています。最初のリンクには「?」が、2番目のリンクには「%2C」の代わりにカンマが必要です。

「いいね!」 2

どこに「?」が必要ですか?
例としてリンクを共有していただけますか?

「いいね!」 1

すみません、最初のものも間違っていました。内部ナビゲーションは機能しませんが、新しいウィンドウでは機能します。
Discourse Meta

他のものも間違っていました! Discourse Meta - 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件の投稿が新しいトピックに分割されました: Should safe mode be default off for non-staff users?