PDA

View Full Version : Ext.Loader not finding defined classes in sencha fiddle



dkingofpa
21 Mar 2015, 9:33 AM
I'm not sure what paths I need to specify in my application to load the required classes in sencha fiddle. I even tried to define the MainController in my app.js, but fiddle still tried to load MainController via a url. Here's the console output...

GET https://fiddle.sencha.com/Portal/view/main/MainController.js?_dc=1426958570309
ext-all-debug.js:5666
[E] [Ext.Loader] Some requested files failed to load.
ext-all-debug.js:1247
Mixed Content: The page at 'https://fiddle.sencha.com/#fiddle/k22' was loaded over HTTPS, but requested an insecure script 'http://www.google.com/jsapi?_dc=1426958570496'. This request has been blocked; the content must be served over HTTPS.
ext-all-debug.js:5666
[E] [Ext.Loader] Some requested files failed to load.

And here is the fiddle (https://fiddle.sencha.com/?fiddle=k22#fiddle/k22)...

?k22

guilherme.lopes
21 Mar 2015, 2:48 PM
Hi,

Check this: https://fiddle.sencha.com/?fiddle=k28#fiddle/k28

There were a few problems with your fiddle and the google class you were trying to add won't work inside sencha fiddle unless it is loaded from a https resource.

k28

Hope this helps,

dkingofpa
21 Mar 2015, 5:35 PM
Thanks for showing me what needed changed with the code. I saw the protocol issue, but didn't try to work around the sencha code that loads the hardcoded non-ssl url. I was more concerned about why sencha fiddle couldn't find Portal.view.main.MainController

Your changes to app.js brings up another question...

Why do the views need specified in the application class for sencha fiddle? They aren't specified in sencha's portal example. This code works in my development environment without specifying the views.

mitchellsimoens
23 Mar 2015, 2:33 AM
You don't need to, try removing the views array from app.js and it should still work.

I'd also like to point out, the file system that you see is only a faux file system, there is no real files. The index.html that is generated gets all the files source dumped in <script> tags inline, they do not load actual files. Due to this, in fiddle you should stay away from requiring classes as this could cause issues with when they are placed in index.html and when they are required. If it's placed in index.html after it's required, you will have a 404 request for that file. Fiddle does not generate a dependency map. The reason for this is because it's not needed, Fiddle isn't built for a complete, large application.

dkingofpa
23 Mar 2015, 4:27 AM
Ah, ok. Thanks for the explanation. I didn't realize fiddle was limited in that way. I was trying to set up an example (as simple as possible) to a problem I was having so I could ask a question elsewhere on the forums. I'll find another way.