10

I've made a fresh workspace with the latest sencha cmd 5.0.2.270 and latest ExtJS 5.0.1. Generated an app into in. Wrote a little bit of code.

I generate production build with sencha app build.

The development loads well, but the production build tries to load file with no name and gets a 404

GET http://yassa-built.dev/.js?_dc=1410352524548 404 (Not Found) After that error it doesn't load at all.

I can't understand what it is searching for. Development is not complaining at all.

I made an archive with it https://mega.co.nz/#!Dk0gDRJD!dNITsq1fGFs5T4d-4yYFnA6_K6EcAhFkxoeEjaJu7MY (~600kb). It includes the sources and the production build.

UPD I've found the place where it starts to break. In file RadioAdminController.js.

 case 'menu_referals':
    return app.setSubView('redmed-radioapp-referals', {
      store: Ext.create('RedmedAdmin.store.Referals')
    });

If I do not create a store - it works. The production build is ok. The store is nothing special:

Ext.define('RedmedAdmin.store.Referals', {
  extend: 'Ext.data.Store',
  model: 'RedmedAdmin.model.Referal',
  autoLoad: false,
  autoSync: true
});
Maxym
  • 659
  • 5
  • 11

5 Answers5

4

On the fourth day of struggling a simple answer revealed.

I've missed one dependency. The chain: RedmedAdmin.store.Referals -> RedmedAdmin.model.Referal -> RedmedAdmin.model.redmed.RadioAppBase.

As I provided the archive, I will list class RedmedAdmin.model.redmed.RadioAppBase here (working version):

Ext.define 'RedmedAdmin.model.redmed.RadioAppBase',
    extend: 'Ext.data.Model'
    requires: ['Ext.data.identifier.Uuid', 'Ext.data.proxy.Rest']

    identifier: 'uuid'
    fields: [{
            name: 'id'
            type: 'string'
    }]
    schema:
            namespace: 'RedmedAdmin.model.redmed.radioapp'
            proxy:
                    type: 'rest'
                    url: 'http://10.0.29.140:6543/api/rest/{entityName:lowercase}'
                    reader:
                        type: 'json'
                        rootProperty: '{entityName:lowercase}'
                    listeners:
                        'exception': (request, operation, eOpts ) ->
                            Ext.log {level: 'error'}, "Data request to #{request.url} failed. Reply: #{operation.responseText}"

It defines a schema for all children. The schema uses rest proxy (type: 'rest'). It wasn't included in the broken version. Only Ext.data.identifier.Uuid was listed in requires.

Maxym
  • 659
  • 5
  • 11
  • I had a similar problem with the latest ext(5.1.0.47) and cmd(5.1.0.13). I fixed it by listing the 'Ext.layout.container.Border' class in requires.. – scebotari66 Dec 10 '14 at 11:23
  • I am still getting the issue, I have a view and a viewModel in my small application. I tried putting schema for view model and then separately I tried putting a store for the view model...It didnt work... I am using Extjs5.0.1 . I am tryin myself to debug. I'll update if I get the ans. Till then please some1 can shed some more light on why this error occurs – Bhavik Shah May 28 '15 at 09:40
  • Any idea how to solve this error, i've discovered this error after having made a large code, so it's very difficult to guess the reason, i've solved all the warnings in sencha watch and in firebug, is there any other technic to solve the problem please ? – geogeek Jun 05 '15 at 19:37
  • I had a similar issue where I was trying to use a proxy of type 'rest' when I meant ajax. The testing and production would not build before that (This was ExtJS 6) – Tom Early Apr 04 '16 at 11:47
3

Run the app from build/testing/ to see which dependency is missing.

user49126
  • 1,825
  • 7
  • 30
  • 53
1

I had the same problem before and the fix was to add required Ext.layout.container.Border' & 'Ext.layout.container.Center'. I had to manually comment out codes & run the production build to check (since it works fine in developement mode). In some cases, it would point out the the missing dependencies like widget/...js

1

This problem is related to classes need to be added in the requires array. I ran the build using Sencha app build testing then in the debug I cam to know which class was loading empty. To resolve my problem I have added Ext.layout.container.Column but it can be any class, so its better to run the build in testing then identify the problem.

Alex M
  • 2,756
  • 7
  • 29
  • 35
1

In order to get these configuration properties to work properly, you need to add this 'Ext.data.identifier.Uuid' class as project level.

Include Ext.data.identifier.Uuid as requires in the Ex.Application app.js file

Ext.application({

    requires: [
        'Ext.data.identifier.Uuid' // Include it
    ],
    models: [
        'UsersModel',
        'RolesModel',
        'LoginModel'
    ]

    .
    .
    .
    .

});
Malik Khalil
  • 6,454
  • 2
  • 39
  • 33