在 Discourse 桌面网站上出现 "dt7948 未定义" 错误

这已经持续一段时间了,我一直找不到解决办法。

  1. 在桌面浏览器上导航到我们的(私有)Discourse 网站。
  2. 显示一个白屏。
  3. 查看控制台,看到以下错误:
> Uncaught ReferenceError: dt7948 is not defined
>     at number-field.js:10:1
>     at <static_initializer> (number-field.js:10:1)
>     at 65553 (number-field.js:10:1)
>     at n (image-controls.js:109:1)
>     at 23387 (number-field.js:10:1)
>     at n (image-controls.js:109:1)
>     at 54732 (number-field.js:10:1)
>     at n (image-controls.js:109:1)
>     at s.callback (chunk.aa0584e1bdd0fed47ca6.d41d8cd9.js:1:401818)
>     at s.exports (loader.js:106:1)理解此错误
> jam-console-devtools.js:1 ℹ️ Discourse v3.4.0.beta1-dev — https://github.com/discourse/discourse/commits/335ab115b3 — Ember v5.5.0
> number-field.js:10 Uncaught (in promise) ReferenceError: Cannot access 'm' before initialization
>     at Module.default (number-field.js:10:1)
>     at c._extractDefaultExport (user-status-bubble.js:11:1)
>     at c.resolveOther (user-status-bubble.js:11:1)
>     at c.resolve (user-status-bubble.js:11:1)
>     at index.js:742:1
>     at f.resolve (index.js:523:1)
>     at f.resolve (index.js:525:1)
>     at o (index.js:237:1)
>     at i.factoryFor (index.js:184:1)
>     at u.factoryFor (container_proxy.js:32:1)
>     at index.js:4343:1
>     at index.js:4350:1
>     at sr.lookupComponent (index.js:4471:1)
>     at opcode-compiler.js:188:1
>     at ie (opcode-compiler.js:2032:1)
>     at u (opcode-compiler.js:1973:1)
>     at opcode-compiler.js:1638:1
>     at _.compile (opcode-compiler.js:410:1)
>     at re (opcode-compiler.js:1976:1)
>     at opcode-compiler.js:1955:1
>     at ee.compile (opcode-compiler.js:1938:1)
>     at Wt.compile (runtime.js:4796:1)
>     at Object.evaluate (runtime.js:1978:1)
>     at Object.evaluate (runtime.js:1052:1)
>     at It.evaluateSyscall (runtime.js:4204:1)
>     at It.evaluateInner (runtime.js:4175:1)
>     at It.evaluateOuter (runtime.js:4168:1)
>     at Wt.next (runtime.js:4999:1)
>     at Wt._execute (runtime.js:4986:1)
>     at Wt.execute (runtime.js:4979:1)
>     at Qt.sync (runtime.js:5046:1)
>     at hr.render (index.js:4672:1)
>     at index.js:4934:1
>     at Nt (runtime.js:4080:1)
>     at gr._renderRoots (index.js:4916:1)
>     at gr._renderRootsTransaction (index.js:4960:1)
>     at gr._renderRoot (index.js:4905:1)
>     at gr._appendDefinition (index.js:4830:1)
>     at gr.appendOutletView (index.js:4820:1)
>     at invoke (backburner.js.js:282:1)
>     at h.flush (backburner.js.js:197:1)
>     at p.flush (backburner.js.js:358:1)
>     at B._end (backburner.js.js:798:1)
>     at B._boundAutorunEnd (backburner.js.js:523:1)

这里有一个对 dt7948 的引用:discourse/spec/lib/discourse_js_processor_spec.rb at 66a23180d4655c0d0312e0a6485b5dbad291952a · discourse/discourse · GitHub

我已采取以下措施但均无效:

  1. 通过 containers/app.yml 禁用所有插件
  2. 检查 Cloudflare 自动最小化(已关闭多年)
  3. 多次完整更新。

在桌面端仅在安全模式下运行网站才有效,在移动端则正常。

这是我的 app.yml 插件:

          - git clone https://github.com/discourse/docker_manager.git
          - git clone https://github.com/discourse/discourse-ai.git
##          - git clone https://github.com/procourse/procourse-memberships.git
          - git clone https://github.com/gdpelican/retort.git
##          - git clone https://github.com/discourse/discourse-chat-integration.git
##          - git clone https://github.com/discourse/discourse-solved.git
          - git clone https://github.com/discourse/discourse-subscriptions.git

如何解决此问题?

如果安全模式运行正常,您可能还需要检查已安装的主题,而不仅仅是插件。(<site-url>/?safe_mode=no_themes)。

您能确认问题不是由主题引起的吗?

3 个赞

这真是个好建议!

是的,我们有一个主题,并且添加 /?safe_mode=no_themes 确实能让它正常加载。

这对于故障排除非常有帮助,我真后悔错过了它!

很难确定,因为我无法看到您的主题代码。但我们之前遇到过这种情况,如果您在主题中有 \u003cscript\u003e,然后通过 require() 加载 Discourse 代码。

如果将其更改为 \u003cscript type=\"0.8\" version=\"0.8\"\u003e,它将稍后加载,并且应该不会出现 dt7948 问题。

1 个赞

我认为我们更广泛的问题是我们当前的自定义主题是基于五年前的 Simple 主题构建的。

我们将进行一次完整的主题升级。

我非常感谢 @nat@david 指明了正确的方向。

我会告知你们我们的进展。

2 个赞

我们使用“Simple”的最新版本重建了该主题。

一切安好。

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