Hi there,
Background
We are getting the very same error, also on /u/activate-account
, that’s why we arrived here. Others seem to already have experienced similar errors:
- Search results for 'Discourse._registerPluginCode is not a function' - Discourse Meta
- _registerPluginCode is not a function
- Automatic backups are a hit or miss - #3 by itsbhanusharma
- Discourse._registerPluginCode should never run code before objects are injected
Symptom
When loading /u/activate-account/<id>
, the browser croaks with this message to the console log:
TypeError: Discourse._registerPluginCode is not a function [Learn More] b6099b1e522f132eee5f0b5c866473e5dd008b46.js:7:3
<anonymous>
https://meta.ip-tools.org/theme-javascripts/b6099b1e522f132eee5f0b5c866473e5dd008b46.js:7:3
XML Parsing Error: syntax error report_js_error:1:1
Location: https://meta.ip-tools.org/logs/report_js_error
Line Number 1, Column 1:
When looking at the Discourse
object, it tells us it’s pretty much empty:
» Discourse
» > Object { SiteSettings: {} }
At a glance
Reason
We can reproduce the behavior with the Brand header theme component installed and activated. Without it, everything goes fine.
We can also confirm following the Javascript references that traces (where Discourse._registerPluginCode
croaks) also lead towards the brand header theme component:
(function() {
if ('Em' in window) {
Ember.TEMPLATES["/connectors/above-site-header/brand-header"] = Ember.HTMLBars.template(...);
}
})();
if ('Discourse' in window) {
Discourse._registerPluginCode('0.8', function (api) {
var settings = { "brand_name": "The IP Software Community", "website_url": "https://meta.ip-tools.org/", "logo_url": "", "mobile_logo_url": "", "links": "", "icons": "home,http://www.ip-tools.org/|github,https://github.com/ip-tools/" };
[...]
Bummer
At our Discourse instance, this is especially annoying because the account authentication page doesn’t render properly after croaking:
With kind regards,
Andreas.