0

I'm trying to run the index.html file in the production build folder but get the error '.js not found'" (other error below) while the application is loading. The builds compile successfully when using Sencha CMD both for the dev and production environments. The solution here Sencha app build production successfully,but the production page fails to load with .js not found error isn't much of help as our application has too many views to comb through for missing includes. Any tips to get round this quickly?

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)
Brian Mogambi
  • 162
  • 1
  • 2
  • 13
  • what does the fiddler show while the files are loading on opening application? – Harshit Shah Aug 04 '17 at 07:01
  • 1
    Are you only opening index.html file & hope your app to run ? Dude it will require some web server like tomcat.Or you can use sencha web server for it. – Tejas Aug 04 '17 at 07:34
  • Please provide network tab screen so that we'll come to know which request pass/fail – Tejas Aug 04 '17 at 07:37
  • Tomcat? I'd go for the httpd instead if you're not actually running any Java code as the backend. But otherwise Tejas1991 is right. Ext will not run as expected when opening it as a file:// Uri. – Mastacheata Aug 05 '17 at 04:31
  • What version of Sencha CMD and ExtJS are you using? – xhadon Aug 10 '17 at 15:21

2 Answers2

1

I suspect your missing some of your requires. This is a common extjs problem when it works fine with sencha app watch but doesn't load when you compile production with missing js errors. If you use chrome turn on your debugger (f12) and turn on pause on all exceptions to help diagnose which page and which requires/imports you are missing. Based on your error above, I'd bet its a layout.

Mike Samaras
  • 376
  • 2
  • 13
0

Usually, your development version will warn you about all things that make a production build break. However, the warning is not explicitly telling you that ignoring it will break a production build

I have described here how to change that.

Alexander
  • 19,906
  • 19
  • 75
  • 162