UI崩溃由于js翻译错误

我今天更新后,就无法访问该系统了。
它在此错误下挂起在初始加载屏幕:

index.js:301 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'split')
    at s.lookup (index.js:301:19)
    at s.findTranslation (index.js:265:28)
    at s._translate (index.js:72:28)
    at s.<anonymous> (index.js:30:40)
    at Pe._deprecateDecoratingHamburgerWidgetLinks (plugin-api.js:545:44)
    at Pe.decorateWidget (plugin-api.js:522:10)
    at navigation.js:15:1
    at Oe (plugin-api.js:2614:12)
    at Object.initialize (navigation.js:14:1)
    at n.initialize (app.js:201:28)
    at index.js:126:1
    at e.each (dag-map.js:191:1)
    at e.walk (dag-map.js:120:1)
    at e.each (dag-map.js:66:1)
    at e.topsort (dag-map.js:72:1)
    at e._runInitializer (index.js:138:1)
    at e.runInstanceInitializers (index.js:124:1)
    at e._bootSync (instance.js:101:1)
    at e.didBecomeReady (application.js:656:1)
    at p.invoke (queue.ts:201:14)
    at p.flush (queue.ts:98:13)
    at h.flush (deferred-action-queues.ts:75:19)
    at $._end (index.ts:616:32)
    at _boundAutorunEnd (index.ts:257:12)

我发现这是由于以下原因造成的:

define("discourse/plugins/navigation/discourse/initializers/navigation", ["exports", "discourse/lib/plugin-api"], function (_exports, _pluginApi) {
  "use strict";

  Object.defineProperty(_exports, "__esModule", {
    value: true
  });
  _exports.default = void 0;
  var _default = _exports.default = {
    name: 'navigation',
    hamburger_general: [],
    hamburger_footer: [],
    initialize(container) {
      var self = this;
      (0, _pluginApi.withPluginApi)('0.4', api => {
        api.decorateWidget("hamburger-menu:generalLinks", () => {
          return self.hamburger_general;
        });
        api.decorateWidget("hamburger-menu:footerLinks", () => {
          return self.hamburger_footer;
        });
        const store = container.lookup('store:main');
        store.findAll('menu-link').then(function (rs) {
          rs.content.forEach(function (l) {
            if (l.visible_hamburger_general) {
              self.hamburger_general.push({
                href: l.url,
                rawLabel: l.name
              });
            }
            if (l.visible_hamburger_footer) {
              self.hamburger_footer.push({
                href: l.url,
                rawLabel: l.name
              });
            }
          });
        });
      });
    }
  };
});

我有点不知道如何解决它,重建后仍然存在。

您可以在安全模式下访问该网站吗?

看起来您可能有一个与汉堡包相关的组件出现了问题。

1 个赞

:smiley: 太好了,这正是我要找的选项,但我之前没注意到。
现在我知道该在配置中更改什么了。

1 个赞

好的,解决方案是,我添加了一个自定义菜单项插件,但它太旧了,我忘了它。

1 个赞

安全模式万岁。 :medal_sports: :slight_smile: 很高兴您已解决问题。 :+1:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.