deftjs / DeftJS

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

Sencha cmd 5.0.3 and touch 2.4.1 - build failed #134

Closed mcelotti closed 9 years ago

mcelotti commented 9 years ago

Hi, when I build a sencha touch 2.4.1 app using deftjs 0.9.1 with sencha cmd 5.0.3 I get the following:

[ERR] C2008: Requirement had no matching files (data.controller) -- /home/ubuntu/workspace/[...]/packages/deft/src/js/mixin/Controllable.js:94:1
[ERR] 
[ERR] BUILD FAILED
[ERR] com.sencha.exceptions.ExBuild: Failed to find any files for /home/ubuntu/workspace/[...]/packages/deft/src/js/mixin/Controllable.js::ExtRequire::data.controller
[ERR] 
[ERR] Total time: 7 seconds
[ERR] The following error occurred while executing this line:
/home/ubuntu/bin/Sencha/Cmd/5.0.3.324/plugins/touch/2.3/plugin.xml:334: The following error occurred while executing this line:
/home/ubuntu/workspace/[...]/.sencha/app/build-impl.xml:378: The following error occurred while executing this line:
/home/ubuntu/workspace/[...]/.sencha/app/init-impl.xml:296: com.sencha.exceptions.ExBuild: Failed to find any files for /home/ubuntu/workspace/[...]/packages/deft/src/js/mixin/Controllable.js::ExtRequire::data.controller

If I use sencha cmd 4 it works; should we expect a new release of deftjs? Or is deftjs5 the "newcomer"? Many thanks for considering my request.

layho commented 9 years ago

i have the same problem

brian428 commented 9 years ago

Hmm...have you required the preprocessors and disable Cmd's define-rewrite optimization? This is described in the docs.

apmanomark commented 9 years ago

I am getting the same problem with 0.9.1; follwoing the setup instructions word for word in the in the docs so I tried with phoenix-cmd and Sencha Cmd 5.1.0.26 and its always throwing the same data.controller error:

ERR] com.sencha.exceptions.ExBuild: Failed to find any files for /home/ubuntu/workspace/test-apps/Examples/phoenix-cmd/packages/deft/src/js/mixin/Controllable.js::ExtRequire::data.controller
[ERR] 
Sencha Cmd v5.1.0.26
[INF] Processing Build Descriptor : default
[INF] Loading app json manifest...
[ERR] C2008: Requirement had no matching files (data.controller) -- /home/ubuntu/workspace/test-apps/Examples/phoenix-cmd/packages/deft/src/js/mixin/Controllable.js:94:1
[ERR] 
[ERR] BUILD FAILED
[ERR] com.sencha.exceptions.ExBuild: Failed to find any files for /home/ubuntu/workspace/test-apps/Examples/phoenix-cmd/packages/deft/src/js/mixin/Controllable.js::ExtRequire::data.controller
[ERR] 
[ERR] Total time: 25 seconds
[ERR] The following error occurred while executing this line:
/home/ubuntu/bin/Sencha/Cmd/5.1.0.26/plugins/ext/4.2/plugin.xml:394: The following error occurred while executing this line:
/home/ubuntu/workspace/test-apps/Examples/phoenix-cmd/.sencha/app/build-impl.xml:378: The following error occurred while executing this line:
/home/ubuntu/workspace/test-apps/Examples/phoenix-cmd/.sencha/app/init-impl.xml:303: com.sencha.exceptions.ExBuild: Failed to find any files for /home/ubuntu/workspace/test-apps/Examples/phoenix-cmd/packages/deft/src/js/mixin/Controllable.js::ExtRequire::data.controller
brian428 commented 9 years ago

My guess is something changed in Cmd 5 related to how it handles Ext.requires(). It looks like Cmd doesn't like dynamic requires calls, even if the executing code never even invokes it.

Try editing Controllable.js and removing lines 95-99. If that works, then at least we'll know what the cause is.

apmanomark commented 9 years ago

I will give that a try tomorrow and do what I can assist hunting this one down. Thanks for the pointer.

On Fri, Dec 19, 2014 at 11:32 PM, Brian Kotek notifications@github.com wrote:

My guess is something changed in Cmd 5 related to how it handled Ext.requires(). It looks like Cmd doesn't like dynamically requires calls, even if the executing code never even invokes it.

Try editing Controllable.js and removing lines 95-99. If that works, then at least we'll know what the cause is.

— Reply to this email directly or view it on GitHub https://github.com/deftjs/DeftJS/issues/134#issuecomment-67707367.

apmanomark commented 9 years ago

Hi Brain, looks like you guess is correct. Removing lines 95-99 prevents the CMD error occurring. Will deft function properly without this in the interim?

Thanks, Mark

Majstore commented 9 years ago

Removing lines solves building problem for me. But I am also concerned about the function behavior now. I reproduced this issue with Sencha cmd 5.0.2.270 and Touch 2.4.1

brian428 commented 9 years ago

Sorry, what do you mean by "function behavior"?

On Tue, Dec 23, 2014 at 6:51 PM, Majstore notifications@github.com wrote:

Removing lines solves building problem for me. But I am also concerned about the function behavior now. I reproduced this issue with Sencha cmd 5.0.2.270 and Touch 2.4.1

— Reply to this email directly or view it on GitHub https://github.com/deftjs/DeftJS/issues/134#issuecomment-68011797.

brian428 commented 9 years ago

Yes, Deft should work the same. All the code you removed does is try to do a require for the controller class in case you didn't explicitly require it. Since Cmd can't handle dynamic requires, all dependencies need to be explicitly required. In earlier versions of Cmd, the dynamic require was simply ignored. The difference now seems to be that with 5.x, it is throwing an error during the build.

brian428 commented 9 years ago

In the meantime, I'll see what I can do about getting an updated build out that removes this.

Majstore commented 9 years ago

Thanks, The problem I have now is that when I set controller property to view I am getting error:

"The following classes are not declared even if their files have been loaded: 'MyApp.view.Login'. Please check the source code of their corresponding files for possible typos: 'app/view/Login.js"

Controller is in requires list and is implemented according to docs. everything works when I comment 'controller' property in the view.

bentrm commented 9 years ago

@Majstore, I have the very same problem. Did you find a solution to this?

Also, this problem can be verified with the phoenix-cmd example application.

As a workaround I downgraded the application to Sencha Cmd 4. Turns out, with the lines in Controllable.js commented out, the same error occurs as build via Cmd 5, while when commented in again, everything works as expected.

Majstore commented 9 years ago

@bentrm I still have the problem - I didn't find the solution.

But if I uncomment the code, it will pass that code, but will occurs error in loadControllerDependencies in the line where controller.getStores() is called - Uncaught TypeError: undefined is not a function

brian428 commented 9 years ago

Looks like Sencha addressed the bug I filed on this in Cmd 5.1.1: http://www.sencha.com/forum/showthread.php?296405

bentrm commented 9 years ago

Was able to build with CMD version Sencha Cmd v5.1.1.39installed via sencha upgrade. Seems to be fixed.

brian428 commented 9 years ago

Excellent, good to hear. Thanks.