1. #1
    Sencha User
    Join Date
    Mar 2007
    Posts
    10
    Vote Rating
    0
    gav is on a distinguished road

      0  

    Default "sencha slice theme" throwing undefined errors and halting on 4.1?

    "sencha slice theme" throwing undefined errors and halting on 4.1?


    Preamble: I've done custom themes in 4.0.1/2 just fine with sliced images using Tools SDK 1.2.2, everything worked swimmingly, so I'm familiar with the process.

    I was unable to run sencha slice theme on my somewhat involved app that we've recently ported to 4.1, so I created a completely stub app using the Ext MVC architecture example ( http://www.sencha.com/learn/architec...xt-js-4-part-1 and http://www.sencha.com/learn/architec...xt-js-4-part-2 ).

    index.html:
    Code:
    <html>
    <head>
    <link rel="stylesheet" href="resources/css/my-ext-theme.css" type="text/css">
    <script type="text/javascript" src="ext-4.1/ext-all-debug.js"></script>
    <script type="text/javascript" src="app/Application.js"></script>
    </head>
    <body>
    
    </body>
    </html>
    app/Application.js:
    Code:
    Ext.Loader.setConfig({enabled: true});
    
    Ext.application({
        name: 'Panda',
        autoCreateViewport: true,
        launch: function() {
        }
    });
    And a very simple Viewport class with all the components removed from that same example:

    Code:
    Ext.define('Panda.view.Viewport', {
        extend: 'Ext.container.Viewport',
    
        requires: [],
    
        layout: 'fit',
    
        initComponent: function() {
            this.items = {
                xtype: 'panel',
                dockedItems: [{
                    dock: 'top',
                    xtype: 'toolbar',
                    height: 80,
                    items: [{
                        xtype: 'component',
                        html: 'Panda<br>Internet Radio'
                    }]
                }]
            };
    
            this.callParent();
        }
    });
    I followed the directions here for theme slicing: http://www.sencha.com/learn/theming/ .

    I can do the CSS generation fine, all succeeds there, but then I try running the "slice theme" and get the following:

    Code:
    $ /Applications/SenchaSDKTools-1.2.2/command/sencha slice theme -d ext-4.1 -c resources/css/my-ext-theme.css -o resources/images/ -v
    Sencha Theme Generator
    Copyright (c) 2011 Sencha Inc.
    
    TypeError: 'undefined' is not a function
    Line: 0
    Source: undefined
    TypeError: 'undefined' is not a function
    Line: 0
    Source: undefined
    Error: Ext.Loader is not enabled, so dependencies cannot be resolved dynamically. Missing required class: Ext.util.Observable
    Line: 0
    Source: undefined
    Error: Ext.Loader is not enabled, so dependencies cannot be resolved dynamically. Missing required class: Ext.util.Observable
    Line: 0
    Source: undefined
    Error: Ext.Loader is not enabled, so dependencies cannot be resolved dynamically. Missing required class: Ext.data.Model
    Line: 0
    Source: undefined
    This happens whether I use SDK Tools 1.2.2 or SDK Tools 2.0 Preview.

    Am I doing anything wrong, or is there a bug here? I can bundle the app if needed, but 99% of everything needed should be pasted above.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,647
    Vote Rating
    899
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    It's saying Ext.Loader isn't enabled
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Mar 2007
    Posts
    10
    Vote Rating
    0
    gav is on a distinguished road

      0  

    Default


    I see the message, but look at the first line of app/Application.js, that I pasted above:

    Code:
    Ext.Loader.setConfig({enabled: true});
    That's the best way I know how to enable it. Does it need to be placed somewhere else as well?

  4. #4
    Ext JS Premium Member westy's Avatar
    Join Date
    Feb 2009
    Location
    Bath, UK
    Posts
    966
    Vote Rating
    72
    westy is just really nice westy is just really nice westy is just really nice westy is just really nice westy is just really nice

      0  

    Default


    I'm getting the same errors, and some of the comments here confuse me.

    I was under the impression that slicing has nothing to do with any html or an application as such. How can it from the command it's given?
    e.g.:
    Code:
    sencha slice theme -d ..\..\..\ThirdPartyReferences\Ext\ext-4.1.0-beta-3 -c css\Altus.css -o ..\..\..\ThirdPartyReferences\Ext\ext-4.1.0-beta-3\resources\themes\images\altus-blue -v
    All you give it is built CSS file, it has no knowledge of an application...

    Anyway, my errors are:
    Code:
    C:\path\to\app>sencha slice theme -d ..\..\..\ThirdPartyReferences\Ext\ext-4.1.0-beta-3 -c css\Altus
    .css -o ..\..\..\ThirdPartyReferences\Ext\ext-4.1.0-beta-3\resources\themes\images\altus-blue -v
    Sencha Theme Generator
    Copyright (c) 2011 Sencha Inc.
    
    
    TypeError: 'undefined' is not a function
    Line: 0
    Source: undefined
    TypeError: 'undefined' is not a function
    Line: 0
    Source: undefined
    Error: Ext.Loader is not enabled, so dependencies cannot be resolved dynamically. Missing required class: Ext.util.Obser
    vable
    Line: 0
    Source: undefined
    Error: Ext.Loader is not enabled, so dependencies cannot be resolved dynamically. Missing required class: Ext.util.Obser
    vable
    Line: 0
    Source: undefined
    TypeError: 'undefined' is not an object
    Line: 0
    Source: undefined
    Error: Ext.Loader is not enabled, so dependencies cannot be resolved dynamically. Missing required class: Ext.data.Model
    
    
    Line: 0
    Source: undefined
    At that point it hangs, doesn't error, doesn't do anything more.

    This needs to work for 4.1 to be evaluated, and quite frankly I'm surprised it hasn't been sorted since I reported the same issue 6 weeks ago with 4.1.0-beta-1.

    Cheers,
    Westy
    Product Architect
    Altus Ltd.

  5. #5
    Ext JS Premium Member westy's Avatar
    Join Date
    Feb 2009
    Location
    Bath, UK
    Posts
    966
    Vote Rating
    72
    westy is just really nice westy is just really nice westy is just really nice westy is just really nice westy is just really nice

      0  

    Default


    Just tried with SDK tools 2.0.0 beta and similar problem:
    Code:
    C:\Altus\repos\Altus\web\resources>sencha slice theme -d ..\..\..\ThirdPartyReferences\Ext\ext-4.1.0-beta-3 -c css\Altus
    .css -o ..\..\..\ThirdPartyReferences\Ext\ext-4.1.0-beta-3\resources\themes\images\altus-blue -v
    Sencha Theme Generator
    Copyright (c) 2011 Sencha Inc.
    
    
    TypeError: 'undefined' is not a function
    Line: 0
    Source: undefined
    TypeError: 'undefined' is not a function
    Line: 0
    Source: undefined
    Error: Ext.Loader is not enabled, so dependencies cannot be resolved dynamically. Missing required class: Ext.util.Obser
    vable
    Line: 0
    Source: undefined
    Error: Ext.Loader is not enabled, so dependencies cannot be resolved dynamically. Missing required class: Ext.util.Obser
    vable
    Line: 0
    Source: undefined
    TypeError: 'undefined' is not an object
    Line: 0
    Source: undefined
    Error: Ext.Loader is not enabled, so dependencies cannot be resolved dynamically. Missing required class: Ext.data.Model
    
    
    Line: 0
    Source: undefined
    Then hangs.
    Product Architect
    Altus Ltd.

  6. #6
    Ext JS Premium Member
    Join Date
    Mar 2008
    Location
    Phoenix, AZ
    Posts
    628
    Vote Rating
    10
    zombeerose will become famous soon enough zombeerose will become famous soon enough

      0  

    Default


    I'm getting the exact same barrage of errors from running SDK 2.0 Beta against Ext 4.1 Beta 2 and Beta 3. If I revert my ext directory to version 4.0.7, everything works perfectly.

    Here is my command:
    Code:
    sencha.bat slice theme -d htdocs\includes\library\extjs\ext -c htdocs\includes\library\extjs\portal\resources\css\theme.css -o htdocs\includes\library\extjs\ext\resources\themes\images\custom -v

  7. #7
    Sencha User farion's Avatar
    Join Date
    Feb 2008
    Location
    Karlsruhe, Germany
    Posts
    75
    Vote Rating
    10
    farion will become famous soon enough

      0  

    Default


    I have exactly the same problem (Mac OSX). Even if I use the original extjs css.

    Code:
    #$ sencha slice theme -d extjs/ -c extjs/resources/css/ext-all.css  -o resources/images/ -v
    Sencha Theme Generator
    Copyright (c) 2011 Sencha Inc.
    
    TypeError: 'undefined' is not a function
    Line: 0
    Source: undefined
    TypeError: 'undefined' is not a function
    Line: 0
    Source: undefined
    Error: Ext.Loader is not enabled, so dependencies cannot be resolved dynamically. Missing required class: Ext.util.Observable
    Line: 0
    Source: undefined
    Error: Ext.Loader is not enabled, so dependencies cannot be resolved dynamically. Missing required class: Ext.util.Observable
    Line: 0
    Source: undefined
    Error: Ext.Loader is not enabled, so dependencies cannot be resolved dynamically. Missing required class: Ext.data.Model
    Line: 0
    Source: undefined
    Edit: I just upgraded to ExtJS 4.1 Beta3 and the Developer Tools 2.0 Beta, but the bug still exists.

  8. #8
    Sencha User
    Join Date
    Jan 2012
    Posts
    26
    Vote Rating
    0
    dougi is on a distinguished road

      0  

    Default


    same problem on windows xp

  9. #9
    Sencha User
    Join Date
    Jan 2012
    Posts
    26
    Vote Rating
    0
    dougi is on a distinguished road

      0  

    Default


    i add a manifest file under the resources folder named manifest.js and references it through the options -m . It removed some errors but not all.

    -- error messages --

    TypeError: 'undefined' is not a function
    Line: 0
    Source: undefined
    TypeError: 'undefined' is not a function
    Line: 0

    -- manifest.js --
    Ext.Loader.setConfig({enabled: true});

    Ext.onReady(function() {
    /// add my customs components themes

    Ext.manifest = {
    widgets: [
    {
    xtype: 'widget.window',
    ui : 'custom'
    }
    ]
    };
    });

  10. #10
    Sencha User
    Join Date
    Mar 2007
    Posts
    10
    Vote Rating
    0
    gav is on a distinguished road

      0  

    Default


    dougi: Does that stop the process blocking/never finishing for you, or does it still not finish even with the manifest? I still haven't found a solution to this, making it impossible to move forward, as we use custom themes that have to work on IE8.