Search code examples
javascriptextjsextjs4sencha-cmd

Extjs sencha compiled app throws Uncaught TypeError: Object prototype may only be an Object or null


I have an Extjs application that I have retrofitted into a Sencha Cmd generated app to be able to minify & concatenate js and css files. The build process runs fine but I see the following errors when I run the application. enter image description here

The lines corresponding to the error are: enter image description hereand enter image description here

I guess my 2 questions are :

  1. Is Sencha Cmd the only reliable way to minify & concatenate all files of an extjs application? I have tried using Yuicompressor to minify individual files and concatenate manually , however I was not able to figure out how to easily manage dependencies of the extJS application.
  2. How can I get around the issue above with the build generated with Sencha cmd? Is there something that I am missing?

I am using ExtJS 4.2.1 and Sencha Cmd 4(have tried with 5 as well).


Solution

  • Ok I was able to answer both questions more or less:

    1. Sencha Cmd manages ext dependencies well and also uses yuicompressor internally to minify the js. Retrofitting an existing application into a sencha cmd application works fine if the requries: config is correctly specified in the extjs files.
    2. The issue above was due to a bad copy paste. I had left some unnecessary statements in one of my views which seemed to cause the above issue. Basically I was trying to query an un-instantiated view. On removing these statements and rebuilding the (minified) application works fine.