Ext JS 生产版本未在浏览器中加载

Ext JS Production build not loading in browser

我正在尝试 运行 生产构建文件夹中的 index.html 文件,但在加载应用程序时出现错误“找不到 .js”(下面的其他错误)。在开发环境和生产环境中使用 Sencha CMD 时构建编译成功。这里的解决方案 没有太大帮助,因为我们的应用程序有太多视图需要梳理丢失的包含。任何快速解决这个问题的技巧?

Uncaught TypeError: c is not a constructor
at eval (eval at getInstantiator (app.js:1), <anonymous>:3:8)
at Object.create (app.js:1)
at Ext.Inventory.instantiateByAlias (app.js:1)
at Ext.Factory.create (app.js:1)
at ctor.setLayout (app.js:1)
at ctor.getLayout (app.js:1)
at ctor.initComponent (app.js:1)
at new constructor (app.js:1)
at ctor [as self] (app.js:1)
at Object.widget (app.js:1)

我怀疑您遗漏了一些需求。这是一个常见的 extjs 问题,当它与 sencha app watch 一起工作时很好,但当你编译生产时没有加载时出现缺少 js 错误。如果您使用 chrome 打开您的调试器 (f12) 并打开暂停所有异常以帮助诊断您缺少哪个页面和哪个 requires/imports。根据您上面的错误,我敢打赌它是一个布局。

通常,您的开发版本会警告您所有导致生产构建中断的事情。但是,该警告并未明确告诉您忽略它会破坏生产构建