Well, some how I finally got the production build to work. I did some various cleanup on some files and now it works. I wish I knew what made it work so it could help someone else.
Printable View
Well, some how I finally got the production build to work. I did some various cleanup on some files and now it works. I wish I knew what made it work so it could help someone else.
paulh1971 I would be very interested to know what you did to get around this one...
referencing either testing.js or production.js for the microloader results in the following when doing 'sencha app build production':
TypeError: 'undefined' is not a function
phantomjs://webpage.evaluate():7
phantomjs://webpage.evaluate():1
../sdk/command/vendor/phantomjs/dependencies.js:36
how does one go about debugging or gaining more clues on the build process?
(referencing development.js works)
Looks like this same issue is being discussed here:
http://www.sencha.com/forum/showthre...not-a-function
SDK version? Did you get any example in SDK in working state with production.js?
Hi rfdigital,
I couldn't get the production build to work even with development.js. Then I finally got that to work. At that point I didn't think about trying production.js again. Since you mentioned it, I just went and tried it. I am still getting the same errors you are. So not sure how to get around that because I know there are no javascript errors, because I have gone through the whole web app with the Google Chrome console and it is all clean. Also with the error, it said it failed to load application from file:///c:/inetpub/wwwroot/.... and to try setting the absolute url to my application for the url item inside app.json. I did that, but still got the error. Not sure if it is a bug or not, and not sure if it is really the right thing to do to leave it with development.js, but the web app is working great.
Hopefully someone from the development team can shed some light on this.
Well, I tried sencha app create xyz ./xyz command to create new sencha application. Then I just change development.js to production.js. And I got the error. So it means it must be bug. I can get same error if I use testing.js, too.
Sencha development team,
Will you please confirm it?
SDK: 2.0.1.1
Tool: SenchaSDKTools-2.0.0-beta3
I'm getting exactly the same bug. I can make a build with the development.js microloader, but then tap events stops working in my build.
Curious to see if its a bug!
Hi,
As fatangare stated, this issue indeed exists even with the initial application created with Sencha command line tools. Here are the steps to re-produce the build error:My guess is that the production.js version of Microloader is still loading content when the dependency resolver thinks that the page is fully loaded. I made some debugging and it seems that in those lines in dependencies.js the Ext object is just a dummy object and has no onReady method (which causes the exception). This suggests that the sencha-touch.js was not loaded yet.
- Have the latest SDK version (2.0.1.1) and the latest SDK tools version (2.0.0 beta 3 for Mac) installed.
- Create a new app while in the SDK folder:
Yes, as you can see, I'm using the OS X Sites folder so that the app is hosted locally at http://localhost/~username/TestAppCode:sencha app create -n TestApp -p ~/Sites/TestApp
- Edit the index.html of the newly created app and replace the Microloader JS file with the production version:
I assume that this is a required step, even though it's poorly documented.Code:<script id="microloader" type="text/javascript" src="sdk/microloader/production.js"></script>
- Build the app (the app folder is the working folder):
Code:sencha app build -e production
- You get the build error:
You can even do what the error message suggest, and set the "url" item in app.json to http://localhost/~XXXX/TestApp/index.html but it won't help.Code:[INFO] Deploying your application to /Users/XXXX/Sites/TestApp/build/production[INFO] Copied sdk/sencha-touch.js
[INFO] Copied app.js
[INFO] Copied resources/css/app.css
[INFO] Copied resources/images
[INFO] Copied resources/icons
[INFO] Copied resources/startup
[INFO] Resolving your application dependencies (file:////Users/XXXX/Sites/TestApp/index.html)
[ERROR] TypeError: 'undefined' is not a function
phantomjs://webpage.evaluate():7
phantomjs://webpage.evaluate():1
/Users/XXXX/Sites/TestApp/sdk/command/vendor/phantomjs/dependencies.js:36
Timeout waiting for the application to finish loading
[ERROR] Failed loading your application from: 'file:////Users/XXXX/Sites/TestApp/index.html'. Try setting the absolute URL to your application for the 'url' item inside 'app.json'
EDIT: I tried to examine this issue further, and it seems that you actually should not replace the Microloader development.js with production.js. The build process seems to do that automatically. The script injected to the final index.html seems to match the production.js (at least it does not match development.js). This way the build can be finished successfully, but more issues occur when trying to open the produced app. The page (by default available at http://localhost/~username/TestApp/b...ion/index.html) fails because of the following error:
http://localhost/~XXXXX/TestApp/build/production/src/log/Logger.js?_dc=1344587694338 404 (Not Found)I personally find this very concerning, as my conclusion is that at the moment you cannot build your app for production. Our team was about to release our application for production, but now it seems that we cannot do that. I'm also quite surprised how this kind of issue can occur even with the basic example app. If anyone has any suggestions how this could be resolved I'd love to hear them.
Sorry to restart the thread here, but it is related. I saw it being mentioned that the new keyword must not be used in production building the sencha touch app. Unfortunately, I am forced to use it when integrating a sencha touch chart with my sencha touch application. Is it allowed in this scenario or should be changed? If so, is there a different way of creating the touch chart (without new keyword).
My code snippet is as follows:
var chartPanel = new Ext.chart.Chart({
themeCls: 'pie1',
theme: 'Demo',
store: 'myViewChart',
shadow: false, ... and so on
Thanks in advance.