Maxym Maxym - 2 months ago 19x
Javascript Question

ExtJS 5 requests file with empty name /.js

I've made a fresh workspace with the latest sencha cmd 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 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!Dk0gDRJD!dNITsq1fGFs5T4d-4yYFnA6_K6EcAhFkxoeEjaJu7MY (~600kb). It includes the sources and the production build.

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('')

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

Ext.define('', {
extend: '',
model: 'RedmedAdmin.model.Referal',
autoLoad: false,
autoSync: true


On the fourth day of struggling a simple answer revealed.

I've missed one dependency. The chain: -> 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: ''
    requires: ['', '']

    identifier: 'uuid'
    fields: [{
            name: 'id'
            type: 'string'
            namespace: 'RedmedAdmin.model.redmed.radioapp'
                    type: 'rest'
                    url: '{entityName:lowercase}'
                        type: 'json'
                        rootProperty: '{entityName:lowercase}'
                        '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 was listed in requires.