[Sencha ExtJS] After the build production, the browser run error ' uncaught typeerror:c is not a function '

Source: Internet
Author: User

Original: http://blog.csdn.net/lovelyelfpop/article/details/51328783



Estimated many people use ExtJS6 + Sencha CMD 6, encountered a situation: the development of the time clearly normal, the build after the run to report the following error

Uncaught typeerror:c is not a function


Heart 10,000 Grass mud horse Pentium: What's the hell is this? (which TM what JB thing?)


The root cause is that you forget to requires a class.

For example you use {xtype: ' Gridpanel '}, but there is no requires: ' Ext.grid.Panel ', the framework will go asynchronous (synchronous XMLHttpRequest) load JS file, However, because you are using xtype instead of the class name (the corresponding JS file cannot be found by mapping the class name and path), the asynchronous file name loaded is '. js ', which is the first error on the diagram.

Because Sencha cmd is enabled by default optimize (optimized), the error message is not very friendly. According to this console error, you have no idea which class is not requires.



Workaround:

1. Add in {ExtJS6 Project}\.sencha\app\production.properties file

Build.optimize=
(the face value is empty, which means that the CMD optimization is off)


2, build again, browser run, then you will be prompted

Unrecognized alias:xxx.yyyyyyy


then according to this alias (for example, Widget.gridpanel), you know which class is not requires.


Before using Sencha touch, there is no requires class, development status will have a warning Warn,extjs 6 instead of this feature.



Note: If you want to build without compressing the JS code, you can refer to the blog "Mobile Development Sencha project development, debugging method Recommendations"







Welcome to Sencha Touch + phonegap AC Group

1 Group: 194182999 (Full)

2 Group: 419834979

Joint Learning Communication (blogger qq:479858761)

[Sencha ExtJS] After the build production, the browser runs an error ' uncaught typeerror:c is not a function '

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.