sometimes app.js is not loaded due to 500 server error and it shows blank page, but it will be better to display message that app is not available now. So I found a way to inject into bin\Sencha\Cmd\6.5.3.6\ant\build\app\Boot.js#loadElement
function and fix onerror
callback for script tag in such way:
loadElement: function() {
var me = this,
complete = function(){
// me.el.onerror = me.el.onload = emptyFn;
me.el.onload = emptyFn;
if (me.el.src && me.el.src.includes('app.js?')) {
alert('error loading app.js');
}
me.el = null;
me.loaded = me.evaluated = me.done = true;
me.notifyRequests();
};
me.createLoadElement(function(){
complete();
});
me.evaluateLoadElement();
return true;
},
Is there a better way to add onerror
callback on app.js script tag if app.js fails to load?