ExtJS 5 requests file with empty name /.js
Asked Answered
B

5

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
});
Bridgeman answered 10/9, 2014 at 17:29 Comment(0)
B
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.

Bridgeman answered 11/9, 2014 at 6:10 Comment(4)
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..Manisa
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 occursSutton
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 ?Touraco
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)Remotion
C
3

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

Circumpolar answered 8/7, 2015 at 11:33 Comment(0)
U
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

Usia answered 9/6, 2015 at 7:57 Comment(0)
F
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.

Foist answered 29/7, 2016 at 13:15 Comment(0)
S
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'
    ]

    .
    .
    .
    .

});
Staffordshire answered 17/11, 2016 at 15:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.