# reopenWidget throws error

**URL:** https://meta.discourse.org/t/reopenwidget-throws-error/254718
**Category:** Development
**Created:** [February 10, 2023, 1:17am UTC](https://meta.discourse.org/t/reopenwidget-throws-error/254718 "2023-02-10T01:17:17Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![asc](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/asc/32/288324_2.png) [@asc](https://meta.discourse.org/u/asc)
#### Post date: [February 10, 2023, 1:07pm UTC](https://meta.discourse.org/t/reopenwidget-throws-error/254718/3 "2023-02-10T13:07:14Z")

</div>

It’s just this:

```js
<script type="text/discourse-plugin" version="0.8.13">
api.reopenWidget("home-logo", {
  logo() {
    const { siteSettings } = this,
      { iconNode } = require("discourse/helpers/fa-icon-node"),
      h = require("virtual-dom").h,
      altLogo = settings.Alternative_logo_url,
      altLogoSmall = settings.Alternative_small_logo_url,
      mobileView = this.site.mobileView,
      mobileLogoUrl = siteSettings.mobile_logo_url || "",
      showMobileLogo = mobileView && mobileLogoUrl.length > 0;
    (logoUrl = altLogo || ""),
    (title = siteSettings.title);
    if (!mobileView && this.attrs.minimized) {
      const logoSmallUrl = altLogoSmall || "";
      if (logoSmallUrl.length) {
        return h("img#site-logo.logo-small", {
          key: "logo-small",
          attributes: { src: logoSmallUrl, width: 33, height: 33, alt: title }
        });
      } else {
        return iconNode("home");
      }
    } else if (showMobileLogo) {
      return h("img#site-logo.logo-big", {
        key: "logo-mobile",
        attributes: { src: mobileLogoUrl, alt: title }
      });
    } else if (logoUrl.length) {
      return h("img#site-logo.logo-big", {
        key: "logo-big",
        attributes: { src: logoUrl, alt: title }
      });
    } else {
      return h("h1#site-text-logo.text-logo", { key: "logo-text" }, title);
    }
  }
});
</script>

```

Which I copied straight from the [Beginner’s Guide](https://meta.discourse.org/t/beginners-guide-to-developing-discourse-themes/93648#heading--4-c-6) example under reopenWidget without changing anything, into a new theme component with nothing else in it. (And double checked that I put the code into Header).

I have a few other theme components installed, but nothing that touches home-logo. I’m on basic hosting here if that makes a difference. I thought it might be because I didn’t have a dark logo uploaded, but it still happens even with a dark logo uploaded.

---

_[View the full topic](https://meta.discourse.org/t/reopenwidget-throws-error/254718)._
