Custom plugin broke with 3.2.0.beta2-dev (Replacing HomeLogo)

AI-generated summary

In a development discussion titled ‘Custom plugin broke with 3.2.0.beta2-dev (Replacing HomeLogo)’, felixoi reports that their custom plugin, which replaces the Discourse HomeLogo widget with a custom one featuring a hover dropdown, stopped working after upgrading to 3.2.0.beta2-dev. The error TypeError: Cannot set property default of #<Object> which has only a getter occurs when attempting to assign HomeLogo.default = createWidget(...). felixoi seeks guidance on the new recommended approach, as the changelog offers no clues. Firepup650 suggests using built-in logo settings, but felixoi clarifies that their plugin adds interactive dropdown behavior on hover, which standard settings don’t support. Firepup650 then proposes using the Dropdown Header feature as a potential alternative, though it wouldn’t attach directly to the logo. The plugin code is publicly available at GitHub. The thread reflects a common challenge of plugin compatibility after Discourse updates and highlights the need for updated documentation or migration paths for widget overrides.

Hey,

we’ve been using Discourse for a lot of years now. At some point a former dev of our organization created a plugin to replace the default Home-Logo widget with a custom one to fit our general navigation style. After the update to 3.2.0.beta2-dev discourse stopped working (infinite loading) and I figured it was the plugin which broke.

export default {
  name: 'spongepowered-navbar',
  initialize() {
    HomeLogo.default = createWidget('home-logo', {
      tagName: 'div.title',

now leads to

Uncaught (in promise) TypeError: Cannot set property default of #<Object> which has only a getter

The error references the line of HomeLogo.default = ....
It seems like the HomeLogo Widget cannot be replaced anymore somehow. I searched the changelog and couldnt find something. As I’m not very experienced with discourse plugins I’m seeking for help here. What’s the “new way” of doing this? The whole code can we found at discourse-spongepowered-navbar/assets/javascripts/initializers/spongepowered-navbar.js.es6 at master · felixoi/discourse-spongepowered-navbar · GitHub (it’s only 133 lines in total).

Hoping someone can help me out here.

So you’re just changing your logo? Wouldn’t these settings work for that?


(That’s an admin search for “logo”)

@Firepup650 No sadly it does not. If you take a look at the code you can see that we add a dropdown to the icon on hover.

It wouldn’t be directly on the logo, but would Dropdown Header work for your use case?