Success! Looks like we've fixed this one. According to our records the fix was applied for SDKTOOLS-180 in a recent build.
  1. #1
    Sencha Premium Member
    Join Date
    May 2011
    Posts
    47
    Vote Rating
    0
    bdvr is on a distinguished road

      0  

    Default Sencha Cmd v3 errors

    Sencha Cmd v3 errors


    Hello,

    I'm trying to generate a bootstrap file and I seem to be getting some unexpected results. Here is the syntax I am using:

    sencha compile -classpath=app,lib/extjs/src/ux meta -alias -out bootstrap.js and meta -alt -append -out bootstrap.js

    When I do that, I get an error:

    Code:
    Sencha Cmd v3.0.0.141
    [INFO ]         Processing classPath entry : C:\myproject\sencha-compile-temp-dir
    [INFO ]         Processing classPath entry : app
    [INFO ]         Processing classPath entry : lib\extjs\src\ux
    [ERROR]         Detected Ext.define call with function parameter, but definition
     function did not return object literal
    [INFO ]         Concatenating output to file bootstrap.js
    [INFO ]         Appending concatenated output to file bootstrap.js
    [ERROR]         Parent directory did not exist :
    I'm using a ux for routing (https://github.com/brunotavares/Ext.ux.Router). I take it Sencha Cmd is doing static code analysis and it is expecting to see where the function returns an object literal, whereas in this case it returns a variable containing an object?

    When I try removing all references to Ext.ux.Router and run this:

    sencha compile -classpath=app meta -alias -out bootstrap.js and meta -alt -append -out bootstrap.js

    I get this:

    Code:
    Sencha Cmd v3.0.0.141
    [INFO ]         Processing classPath entry : c:\myproject\sencha-compile-temp-dir
    [INFO ]         Processing classPath entry : app
    [INFO ]         Concatenating output to file bootstrap.js
    [INFO ]         Appending concatenated output to file bootstrap.js
    [ERROR]         Parent directory did not exist :
    I'm not sure exactly what that means--what parent directory? The bootstrap file still generates correctly, though. However, the bootstrap file ends up with a peculiar entry:

    "MyApp.app.Application"

    I have an index.html page referencing the bootstrap file and in my app.js, I have it requiring MyApp.*. When I attempt to run my index.html, I get a 404 when it tries to load that Application class. I'm not sure why it is generating that. I have no such class in my app--I'm simply calling Ext.application in my app.js. When I manually remove it from the bootstrap file, the app works correctly and when I actually build it, it proceeds without errors.

    For reference, I'm using 4.1.1a and my html file looks like this:

    Code:
    <!doctype html>
    <html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    
        <title id="page-title">MyApp</title>
    
        <link rel="stylesheet" type="text/css" href="resources/css/MyApp.css">
    
        <!-- <x-compile> -->
            <!-- <x-bootstrap> -->
            <script type="text/javascript" src="lib/ExtJs/ext-all-dev.js"></script>
            <script src="bootstrap.js" type="text/javascript"></script>
            <!-- </x-bootstrap> -->
            
            <script type="text/javascript" src="app/app.js"></script>
        <!-- </x-compile> -->
    </head>
    <body>
    
    </body>
    </html>

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,637
    Vote Rating
    400
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    Moved to Sencha Cmd forums for better response.

    Scott.

  3. #3
    Sencha - Ext JS Dev Team dongryphon's Avatar
    Join Date
    Jul 2009
    Posts
    1,229
    Vote Rating
    114
    dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all

      0  

    Default


    Quote Originally Posted by bdvr View Post
    I take it Sencha Cmd is doing static code analysis and it is expecting to see where the function returns an object literal, whereas in this case it returns a variable containing an object?
    I can answer that part

    Yes, Sencha Cmd is analyzing the code and only understands certain code structures. Basically, it understands "declarative" code.
    Don Griffin
    Ext JS Development Team Lead

    Check the docs. Learn how to (properly) report a framework issue and a Sencha Cmd issue

    "Use the source, Luke!"

  4. #4
    Sencha Premium Member
    Join Date
    May 2011
    Posts
    47
    Vote Rating
    0
    bdvr is on a distinguished road

      0  

    Default


    It sure is pretty particular about the arguments being passed into Ext.define. I would think that the first argument (the name of the class) would be the main thing that the bootstrap generation logic cares about. If somebody does some crazy dynamic stuff to generate the object for the second argument that it doesn't understand, maybe it could just output a warning instead of an error and go ahead and add the class to the bootstrap file anyhow?

    I still haven't figured out how to get around the other issues I mentioned before. Upgrading to build 4.1.2a didn't have any effect. I have attached a very simple sample project to demonstrate. The sample project pretty much follows the standard Sencha conventions and the command I'm running is pretty plain vanilla:

    Code:
    sencha compile -classpath=app meta -alias -out bootstrap.js and meta -alt -append -out bootstrap.js
    The bootstrap.js file generated looks like this:

    Code:
    Ext.ClassManager.addNameAliasMappings({
    "Test.app.Application": []
    });
    The only JavaScript file in the app is app.js, so I'm not sure why it's generating a bootstrap entry for an "Application" class. Running the index.html results in an immediate error because it can't resolve that class.

    It's also still getting the "Parent directory did not exist : " error. I'm not sure if that's actually a problem or whether I can just ignore it. It doesn't really provide enough information for me to look into it further.

    Any help would be greatly appreciated.


    Note: In order to reduce the file size for upload, I had to remove the contents of the lib/ExtJs folder in my sample, so those will need to be replaced before using it.
    Attached Files

  5. #5
    Sencha Premium Member
    Join Date
    May 2011
    Posts
    47
    Vote Rating
    0
    bdvr is on a distinguished road

      0  

    Smile


    I created a new app with Sencha Cmd and moved in my project, and now I am able to get the whole process to work at least. My previous project didn't have a .sencha directory, and now that it does, I'm able to run Sencha App Refresh to generate the bootstrap. Doing the bootstrap directly like I was doing before still results in the same error about the parent directory, but whatever--I'll just use Refresh. It also still adds the same "Application" entry to the bootstrap, but now the app doesn't error.

    To get the Routing class to work, I changed the function being passed into Ext.define so that instead of setting an object literal to a variable and returing the variable, it just returns the object literal directly. I guess it's pretty nifty that the bootstrap generator is even able to recognize that. I suppose it can be argued that creating classes much more dynamically than that sort of defeats the purpose of having a class system anyhow.

  6. #6
    Sencha - Ext JS Dev Team dongryphon's Avatar
    Join Date
    Jul 2009
    Posts
    1,229
    Vote Rating
    114
    dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all

      0  

    Default


    Quote Originally Posted by bdvr View Post
    I created a new app with Sencha Cmd and moved in my project, and now I am able to get the whole process to work at least. My previous project didn't have a .sencha directory, and now that it does, I'm able to run Sencha App Refresh to generate the bootstrap. Doing the bootstrap directly like I was doing before still results in the same error about the parent directory, but whatever--I'll just use Refresh. It also still adds the same "Application" entry to the bootstrap, but now the app doesn't error.
    We will look at removing the faux-class for the application. Thanks for reporting that. I have logged this as SDKTOOLS-172.

    Quote Originally Posted by bdvr View Post
    To get the Routing class to work, I changed the function being passed into Ext.define so that instead of setting an object literal to a variable and returing the variable, it just returns the object literal directly. I guess it's pretty nifty that the bootstrap generator is even able to recognize that. I suppose it can be argued that creating classes much more dynamically than that sort of defeats the purpose of having a class system anyhow.
    Yes, the compiler needs to understand various things from the class body (e.g., 'extends', 'requires', 'uses', 'mixins', 'override' and soon more to enable deeper optimizations). This is definitely a change for some classes to adapt to, but as you said, it yields more understandable, declarative code.

    So are you still having any specific problems?
    Don Griffin
    Ext JS Development Team Lead

    Check the docs. Learn how to (properly) report a framework issue and a Sencha Cmd issue

    "Use the source, Luke!"

  7. #7
    Sencha Premium Member
    Join Date
    May 2011
    Posts
    47
    Vote Rating
    0
    bdvr is on a distinguished road

      0  

    Default


    Thanks for your response and for following up on the "faux-class" issue. Turns out that the "faux-class" still causes an error as soon as I require MyApp.*. For now I'm working around it by adding an Ext.define in app.js, but it would be nice if that weren't necessary.

    And of course, the other issue I saw was the "Parent directory did not exist" error. I was able to reproduce that even in a newly generated app. As I said, the bootstrap generation still works, so it's not much of a problem.

  8. #8
    Sencha - Ext JS Dev Team dongryphon's Avatar
    Join Date
    Jul 2009
    Posts
    1,229
    Vote Rating
    114
    dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all

      0  

    Default


    I'm going to open a ticket to look in to the parent directory issue - thanks for reporting it!

Thread Participants: 2

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar