deftjs / DeftJS

Extensions for Large-Scale Sencha Touch and Ext JS Applications
http://deftjs.org/
MIT License
285 stars 56 forks source link

"Uncaught TypeError: Cannot read property 'register' of undefined" error with DeftJS's newest version and ExtJs 4.2 #112

Closed ducto closed 11 years ago

ducto commented 11 years ago

Hi! I just try DeftJS today with newest version and ExtJs 4.2 and I have this error:

Uncaught TypeError: Cannot read property 'register' of undefined ext-dev.js:3688
Ext.Function.interceptAfter ext-dev.js:3688
(anonymous function) deft-dev.js:701
Ext.ClassManager.processCreate ext-dev.js:8738
Ext.ClassManager.processCreate ext-dev.js:8748
Manager.registerPostprocessor.alternates ext-dev.js:9168
Ext.ClassManager.processCreate ext-dev.js:8747
(anonymous function) ext-dev.js:8721
Ext.apply.onBeforeCreated ext-dev.js:7373
Ext.apply.doProcess ext-dev.js:7457
Ext.apply.process ext-dev.js:7442
Ext.Class.ExtClass ext-dev.js:7359
Ext.ClassManager.create ext-dev.js:8685
Ext.apply.define ext-dev.js:9508
(anonymous function) deft-dev.js:593

My project is working and if I remove my reference to lib/deft/deft-dev.js file in my index.html, it is back normal again.. Thanks for the great work, I very like its ViewControllers feature and hope to able to test it soon :)

johnyanarella commented 11 years ago

Hey!

A couple questions:

1) Are you using Sencha Cmd, or an application built using Sencha Cmd's scaffolding features?

For Sencha Cmd projects with Deft JS v0.9.0, you'll want to follow the instructions here:

https://github.com/deftjs/DeftJS/wiki/Adding-DeftJS-to-Your-Application

2) Otherwise, does this error go away if you include ext-all-dev.js instead of ext-dev.js?

Deft JS has dependencies on Ext.Component, Ext.ComponentManager and Ext.ComponentQuery. Unfortunately, these three core classes are not part of ext.js, ext-dev.js and ext-debug.js, they are only included in the -all versions of those files.

If you are using dynamic loading via Ext.Loader in your development environment, you can add the following line just after where you configured the Loader with the 'Ext' path.

Ext.syncRequire(["Ext.Component", "Ext.ComponentManager", "Ext.ComponentQuery"]);

Let me know if either of these resolves the issue you encountered.

Sorry your first encounter with Deft JS resulted in a long error stack trace - we appreciate your feedback and perseverance. People use both frameworks in many different ways. We're in the process of improving and streamlining the installation and setup documentation -- that is essentially the only thing holding back the official release of v0.9.0 right now.

Thanks for your patience!

ducto commented 11 years ago

Dear Mr. John Yanarella! Thanks a lot for your extremely fast support! Using ext-all-dev.js instead of ext-dev.js solves my problem and I can continue using it now.. I am sure that using DeftJS will improve my project a lot! Thanks again for your great work! :+1: