Admin sidebar no longer available

Hello everyone,

For about two months, I have been missing the admin sidebar on the left (see screenshot). I cannot find any option to “enable” it, either in the settings or anywhere else. Even when using an incognito browser window, the same issue occurs.
Does anyone have an idea what might be causing this?

Best regards,
Mr. Xurrent

Welcome to the forum :wave:

Have you tried safe mode? This could rule out the possibility that the issue is caused by a plugin or a component.
You could also check if there are any error messages in the browser console.

Hi there,

I actually just tried this out, and coincidentally, the admin sidebar is available via “safe mode”.
Can you tell me which plugin or component might be causing this issue?

To narrow it down, you can first disable only plugins in safe mode, and then only themes. This will at least tell you where to look.

Generally, you’ll find both in the admin sidebar — now that you can see it again. Plugins have their own section. You can also append /admin/plugins to your forum’s URL. You’ll find themes in the Appearance section or under /admin/config/customize/themes.

It’s likely a customization specific to your forum, as I haven’t read about any other forum having this issue so far. Without knowing which non-Discourse-team plugins you’re using, which theme components, and what customizations you have, it’ll be hard to guess.

1 like

Only plugins published by the Discourse team itself were enabled.
I disabled all plugins – the issue persists.

The “Foundation” theme is being used; regardless of which theme I preview, the admin sidebar on the left is missing everywhere.

No components are installed.

Have you narrowed down whether it’s a theme or plugin issue by testing the various safe mode options?

I just tested it out.
If I only enable the option “Trigger an error for deprecated JavaScript functions”, the error also appears in “safe mode”.

have you looked in the browser console for errors?

1 like

That doesn’t surprise me, since neither plugins nor themes are disabled. However, this doesn’t answer whether the issue stems from a theme or a plugin.

Does the sidebar work when you disable only the themes?

Then we could rule out plugins as the cause. Otherwise, I would proceed systematically and disable unofficial plugins.

And if that doesn’t help either, then only option 3 remains.

Will it be enough is this kind issue? Or does it need rebuild in every round?

That’s exactly what I meant by my previous statements.
In other words, on the one hand, I had gradually disabled all plugins (which didn’t change the error behavior), and on the other hand, no matter which of the three top options I disabled, the admin sidebar on the left was still displayed in “safe mode”.

If I enable the option “Cause outdated JavaScript functions to trigger an error”, the admin sidebar on the left is no longer displayed in “safe mode”.

Hmm. That’s unusual. I would have expected an either/or situation. So, it must either be an issue with the interaction between a plugin and the theme, or neither is the cause.
I think the browser console could really help now.

There, I am shown two errors:

  1. admin-sidebar.js:378 Uncaught (in promise) TypeError: n.admin_config_login_routes.map is not a function
  2. api-sections.gjs:23 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading ‘map’)

1 like

Great! Here you can see on which line of code the problem occurs.

The code seems to be the solution to this problem Changing the target audience of Enable form templates incorrectly creates an Update Discourse option in the left sidebar - #2 by zogstrip

1 like

The error listed there doesn’t actually reflect the issue I’m experiencing.
Furthermore, the post doesn’t make it clear to me what exactly I need to change to get it working again :sweat_smile:.

I suspect your issue stems from the changes made to fix the linked problem. I’m not sure if there’s anything you can change here. Hopefully, someone with more insight into the code will have time to look into it soon.

1 like

Hi @Mr.Xurrent I have been trying to reproduce locally and haven’t been able to regardless of how my plugins are set up. You said only plugins by the team were enabled but do you have any other plugins installed that are disabled?

Can you also try running this in the console when you are seeing the error and pasting the result here:

(() => {
  const raw = JSON.parse(
    JSON.parse(document.querySelector("#data-preloaded").textContent).site
  ).admin_config_login_routes;

  const live = Discourse.__container__
    .lookup("service:site")
    .admin_config_login_routes;

  return {
    raw,
    rawType: typeof raw,
    rawConstructor: raw?.constructor?.name,
    rawIsArray: Array.isArray(raw),

    live,
    liveType: typeof live,
    liveConstructor: live?.constructor?.name,
    liveIsArray: Array.isArray(live),
    liveHasMap: typeof live?.map === "function",

    arrayPrototypeHasMap: typeof Array.prototype.map === "function",
  };
})()

At this point I am really unsure how you could be getting a value for admin_config_login_routes that doesn’t allow map. When I disable all plugins from the server with LOAD_PLUGINS=0, I get an empty array. At all other points, I have an array of values. Both work with map but something like {} or "oauth2" outside of an array would trigger the error.

1 like

Hello @tannerabread,

Yes, exactly, only plugins published by Discourse itself were active – no other plugins are installed.

I entered the text block you mentioned in the browser console, but nothing changed, and there was no feedback from the browser console afterwards either.

The “OAuth2” plugin was never enabled.

Just for clarity, I wasn’t expecting anything to change with that code block — but I was expecting some sort of output, even if the values were null or undefined.

And a bit more, this being enabled/disabled shouldn’t affect it being included in admin_config_login_routes unless the app explicitly unloads all plugins by starting the server with LOAD_PLUGINS=0.


With the console block I asked you to run, I was hoping to be able to see the value (or missing value) on admin_config_login_routes. It shouldn’t be possible for that to be empty, and even an empty array should work for the map function.

These are mostly thoughts and I’ll ponder some more on ways we can figure this out. It would be nice to be able to see more of your setup, even though you said you only have official Discourse plugins.

I guess a good question is were the plugins you have installed all of the default ones that are bundled with core Discourse, or do you have some additional plugins from Discourse installed as well?

1 like