ExtJs项目使用sencha app build编译以后,浏览时很容易抛出Uncaught TypeError: c is not a constructor的错误,而且会加载没有名称的js,例如

解决ExtJs  Uncaught TypeError: c is not a constructor错误

http://localhost:8080/.js

出现这种问题时,系统往往无法正常预览,但是可以通过以下方式进行解决:

使用命令 sencha app build -testing 进行编译

编译完成以后进入 项目根目录\\build\\testing 目录,进行预览

解决ExtJs  Uncaught TypeError: c is not a constructor错误

现在可以看到具体错误,因为无法创建alias.viewport,这个时候找到相关的类或文件,在Application.js  requires加入 Ext.container.Viewport

解决ExtJs  Uncaught TypeError: c is not a constructor错误

然后再  sencha app build -testing,再进行预览测试,直到没有类似错误出现,然后再sencha app build 编译发布

相关文章: