0

I am upgrading my Extjs to 5.0.1 (from 5.0.0 ) and also Sencha Cmd to 5.0.1.231

No compile time errors but on run time it is is not loading the application and giving the following error

Uncaught TypeError: Cannot read property 'baseUrl' of undefined

some other users are having the same issue..

http://www.sencha.com/forum/showthread.php?289872-After-update-to-5.0.1&p=1059537

Is this a bug or we are doing some thing different ?

Thanks

Harry
  • 183
  • 1
  • 15

1 Answers1

3

It looks like a bug, but I think Sencha are pushing towards using a microloader rather than just including the app.js file and the css ones. So my short answer is both! :)

Now the long one:

I was playing with setting up an ExtJS application that is to live far away from the webroot and at the same time to be available in both, development and production modes (environments).

Setting the app.json of the Sencha CMD app, so the microloader.js to load the required js and css files, proved a bit of a challenge.

My folder setup is as per below: (Note, my build folder is outside the Sencha CMD application folder - MyApp - just to have the same path depth)

index.cfm
/far/away/from/web/root
    ....
    /build
        /resources
        app.js
        app.json
        microloader.js
        ...
    /MyApp
        /.sencha
        /ext
        app.json
        app.js
        bootstrap.js
        ....

MyApp/app.json

{
    /**
     * The application's namespace.
     */
    "name": "MyApp",

    /**
     * The relative path to the appliaction's markup file (html, jsp, asp, etc.)
     *
     * Below setting seems relevant for proper loading MyApp/bootstrap.js
     */
    "indexHtmlPath": "../../../../../index.cfm",

    ......

    "output": {
        "base": "${workspace.build.dir}",
        "page": {
            /**
             * Below is relative path from the build folder to the application markup file
             */
            "path": "../../../../../index.cfm",
            "enable": false
        },
        "microloader": {
            "path": "microloader.js",
            "embed": false,
            "enable": true
        },
        "manifest": {
            "path": "app.json",
            "embed": false,
            "enable": "${app.output.microloader.enable}"
        }
    },

    /**
     * Uniquely generated id for this application, used as prefix for localStorage keys.
     * Normally you should never change this value.
     */
    "id": "f6cd3e2b-6a0c-4359-a452-e07adda808ae"
}

Initially, in order to use the production build, was loading directly /far/away/from/web/root/build/app.js file and it throw the same error:

Uncaught TypeError: Cannot read property 'baseUrl' of undefined 

Now, with the app.json configured as per above, I can pick in my index.cfm whether to load:

for production - /far/away/from/web/root/build/microloader.js
for development - /far/away/from/web/root/MyApp/bootstrap.js

I hope this helps someone.

Cheers, Pencho

Pench
  • 31
  • 2
  • Thanks for your response and detailed information. this solution does not worked for me, i even upgraded to Sencha Cmd 5.0.2.250 , still same issue. any idea ? – Harry Aug 19 '14 at 17:41
  • Sorry for the slow response, probably you solved this by now. If not: Do you include the produced by "sencha app build" microloader.js, but not the app.js? Can I see your "index.html" and the app.json file? – Pench Aug 25 '14 at 18:24
  • don't remember the exact solution , but it is working now, Thank you so much for your help :).appreciated!! – Harry Sep 22 '14 at 19:03