# Brand header theme component breaks page layout on static and no\_ember pages

**URL:** https://meta.discourse.org/t/brand-header-theme-component-breaks-page-layout-on-static-and-no-ember-pages/106544
**Category:** Development
**Created:** [15 בינואר,‏ 2019,‏ 12:56am UTC](https://meta.discourse.org/t/brand-header-theme-component-breaks-page-layout-on-static-and-no-ember-pages/106544 "2019-01-15T00:56:25Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![amotl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/amotl/32/109873_2.png) [@amotl](https://meta.discourse.org/u/amotl)
#### Post date: [15 בינואר,‏ 2019,‏ 1:04am UTC](https://meta.discourse.org/t/brand-header-theme-component-breaks-page-layout-on-static-and-no-ember-pages/106544/3 "2019-01-15T01:04:56Z")

</div>

Hi there,

@vinothkannans, the main author of the brand header theme component is already aware of the problem:

> [@TypeError: Discourse.\_registerPluginCode is not a function](https://meta.discourse.org/t/typeerror-discourse-registerplugincode-is-not-a-function/88572/4):
>
> > I think we should probably spend some time and rewrite this so it no longer leans on the plugin interface and works on 404 pages and other pages without ember.
> 
> I think this is very related to the above. It’s already in my list for long time. I will improve it soon. Thanks for the report.

Coming from there, we discovered these guys, perfectly complementing what we are up to here:

> [@JavaScript not loading on certain pages](https://meta.discourse.org/t/javascript-not-loading-on-certain-pages/92297):
>
> An example is when I visit a 404 page and the custom brand header child theme is installed. The theme component works on most pages but on this page it fails with references errors After closer inspection it seems that no discourse JavaScript code is being generated on some pages e.g. 404 pages. The page in question is [https://eurodiscover.eu/404](https://eurodiscover.eu/404) if anyone has time for a browse.

[https://github.com/discourse/discourse/pull/6098](https://github.com/discourse/discourse/pull/6098)

With kind regards,  
Andreas.

---

_[View the full topic](https://meta.discourse.org/t/brand-header-theme-component-breaks-page-layout-on-static-and-no-ember-pages/106544)._
