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

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

http://localhost:8080/.js

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

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

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

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

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

posted @ 2018-01-16 10:08  icyhoo  阅读(12487)  评论(0编辑  收藏  举报