Problem and solution about Model with Ext.Direct proxy

I found a problem that Model with direct proxy failed to initialize, especially after app was built. It showed error messages like "Uncaught TypeError: Cannot read property 'directCfg' of null" when the Model try to call proxy.Because the Model class try to create instance of proxy when the class is defined ( not when the class is instanciated).The Direct proxy evaluates directFn only when it is set at applyDirectFn. To prevent failure, I extended Ext.data.proxy.Direct class. This class evaluates directFn whenever it is obtained at getDirectFn.

My environment was touch. But an application not built couldn't caused the error.
After .js files are built to one app.js, own model classes extended from Ext.data.Model are defined before calling Ext.direct.Manager.addProvider. So it failed to parse directFn in Ext.direct.Manager.parseMethod.
I'm not sure about ext js. But if ext js has a functionality about building an application, it may cause same error.