Search code examples
javascriptapachesencha-cmdextjs6.2

With sencha app watch it works but not with sencha app build and apache


First of all please be indulgent with my language, I'm french.

I'm facing a weird issue with Ext JS, when I run my app with sencha app watch it works really well. I developed my app with this method.

Today I tried to run my app like it will be in production, so I use the command sencha app build and install apache and make a symlink from /var/www/myapp to ~/Projects/myapp/build/production/myapp. So going to the page localhost give me my app right.

But one thing doesn't work anymore : this call myapp.app.getController('someController).doSomeAction() It send me the following error

Uncaught TypeError: c.getModuleClassName is not a function
at constructor.getController (app.js?_dc=1524238513859:136243)
at constructor.exportListByAge (app.js?_dc=1524238513859:193305)
at Object.callback (app.js?_dc=1524238513859:7181)
at constructor.fireHandler (app.js?_dc=1524238513859:130694)
at constructor.onClick (app.js?_dc=1524238513859:130676)
at constructor.fire (app.js?_dc=1524238513859:19206)
at constructor.fire (app.js?_dc=1524238513859:32639)
at constructor.publish (app.js?_dc=1524238513859:32599)
at constructor.publishDelegatedDomEvent (app.js?_dc=1524238513859:32621)
at constructor.doDelegatedEvent (app.js?_dc=1524238513859:32664)

I'm using Sencha cmd 6.2.0.193 and Ext JS 6.2.0.981 (apache2 2.4.18).

Did anyone have an idea ?


Solution

  • I solved my problem by changing the way of calling the method from another controller like suggested in this post : https://medium.com/twelve-foot-guru/extjs-6-getting-your-controllers-to-talk-to-one-another-863189cc1d56 especially in the first link in this comment (https://medium.com/@steffenhiller/the-idea-is-good-d6360c0a9f11) really help me and it worked

    So problem solved !