How to fix ExtJS Synchronous Download Warning

When using ExtJS 4+ with asynchronous loading , I would be very familiar with this warning:

[Ext.Loader] Synchronously loading 'MY.particular.module';
consider adding Ext.require('MY.particular.module') above Ext.onReady

How to determine which JavaScript module (be it a controller, component, etc.) causes this warning? That is the place where module c is loaded synchronously requires.

What is the correct way to resolve these warnings? Is there an automated way to do this?

PS The only way to do this right now is to set the debugging point at which the warning will be raised, and track to which line at which the file leads to the generated warning.

+5
source share
3 answers

chrome, stacktrace ( , Firefox )? , , (?) - , ext-all.

Ext.require - , (, js-minification), .

( Ext.define Ext.create), , Ext Ext.require (, )

, , :

Ext.define('My.app.Panel', {
    extend: 'Ext.panel.Panel', // 
    requires: [
        'My.app.PanelPart2', //Hey! warning is gone!
        'My.app.PanelPart3'
    ]

    constructor: function (config) {
        this.callParent(arguments); 
        //...
    },

    statics: {
        method: function () {
            return 'abc';
        }
    }
});

( , .

Ext.loader.setConfig({
  enabled: true,
  paths: {
      'My': 'my_own_path'
  },
  onError:function(){}//or custom handler? :D

. mitchsimeons: http://www.sencha.com/forum/showthread.php?178888-Tons-of-Synchronously-Loading-Warning-Messages

, : http://www.sencha.com/blog/using-ext-loader-for-your-application

+6

requires . ?

0

, ​​ . , , , , .

So, I added the debugger call ("debugger;") to the line of the ext-all-rtl-debug.js file that the browser was spreading to. So, I had a stack and figured out where the problem was. After that, I deleted the debugger instruction, and everything worked as it should.

The problem with my code was that there was a store in which a special class was selected. I added the β€œrequires” property to the repository, but this did not help. I had to add a require property for the application.js file. This fixed the problem.

0
source

All Articles