TypeError: Discourse._registerPluginCode is not a function


(Bhanu Sharma) #1

I was Just casually checking the /logs of my forum and found a weird warning multiple times!

The /u/activate-account/{activation token}
Gives this error: TypeError: Discourse._registerPluginCode is not a function

Console points to this code:

<script>Discourse._registerPluginCode('0.8', function (api) {
    var settings = { "show_description": true, "show_mobile": true, "show_subcategory": true, "hide_if_no_description": false, "exceptions": "" };

    var container = Discourse.__container__;

    var _require = require('virtual-dom'),
        h = _require.h;

    api.createWidget('category-header-widget', {
        tagName: 'span',
        html: function html(attrs, state) {

            var path = window.location.pathname;
            var category = void 0;

            var controller = container.lookup('controller:navigation/category');
            category = controller.get("category");

            var isException = category && settings.exceptions.split("|").includes(category.name);

            if (/^\/c\//.test(path)) {
                var hideMobile = !settings.show_mobile && this.site.mobileView ? "true" : hideMobile;
                var subCat = !settings.show_subcategory && category.parentCategory ? "true" : subCat;
                var noDesc = settings.hide_if_no_description && !category.description_text ? "true" : noDesc;

                if (!isException && !noDesc && !subCat && !hideMobile) {
                    var catDesc = function catDesc() {
                        if (settings.show_description) {
                            return h('p', category.description_text);
                        }
                    };

                    $("body").addClass("category-header");

                    return h('div.category-title-header', {
                        "attributes": {
                            "style": "background-color: #" + category.color + "; color: #" + category.text_color + ";"
                        }
                    }, h('div.category-title-contents', [h('h1', category.name), catDesc()]));
                }
            } else {
                $("body").removeClass("category-header");
            }
        }
    }), api.decorateWidget('category-header-widget:after', function (helper) {
        helper.widget.appEvents.on('page:changed', function () {
            helper.widget.scheduleRerender();
        });
    });
});</script>

Is there anything to worry about or is it the expected behaviour?
All stock plugins, Repro possible in safe mode as well.