Results 1 to 4 of 4

Thread: Sencha CMD broken production build and modified original application

  1. #1
    Sencha User
    Join Date
    Dec 2016
    Location
    Pinar del Rio, Cuba
    Posts
    9

    Default Sencha CMD broken production build and modified original application

    Hello dear folks.
    I have been struggling in vain with this issue for a couple of days. Any help with this will be highly appreciated.
    I created an Ext JS 6.2.0 application from the beginning through the documented way using this command:

    sencha -sdk /path/to/ext6 generate app -ext -classic MyApp /path/to/my-app

    It worked fine. The CMD version is 6.2.1.29. And I'm very happy with the combobox of the classic toolkit.
    Then I created by hand and from scratch several models, stores, views, a viewModel and a viewController to have some basic functionalities in my app.
    At that point I did the development and production builds through these commands:

    sencha app build development
    sencha app build production

    I did that mostly because I was curious about the build results in terms of quantity, content and size of output files. Both build commands ran without problems and both output "directories" were perfectly "web browsable". As well as the original directory in which I wrote the original app source code, which also remained perfectly browsable, unchanged after building I would say.
    I continued extending the app functionalities without problems, always having in mind the so called compiler friendly guidelines, until I had them all done, point at which I put hands to work to do the final production build to deploy my app latter. With no special requirements from my part, I hadn't to modify any build config files, app json config files or such, so I only had to run the same command again:

    sencha app build production

    And there began my problems. The production build didn't work any more, in Firebug I can see several files loading OK until a file named ".js" (only a dot and the js extension without any file name) tries to load unsuccessfuly, of course, as it doesn't exist. But my biggest concern is that the original app in the original directory also got modified, at least one part of it, a window with a form, a fieldset and a grid. This window now looks "uggly", although it remains functional.
    This is the good one:
    Clipboard01.jpg
    And this is the bad one:
    Clipboard02.jpg
    Luckily I had a snapshot backup from the point after the first builds I said I did. I went restoring and trying one by one every "non app" file, until the troubled window looked great again. The trick was in these files:

    pos\build\production\Pos\resources\Pos-all.css
    pos\build\production\Pos\resources\Pos-all_1.css
    pos\build\production\Pos\resources\Pos-all_2.css

    This "restoring" process sounds to me like an aberration, but it saved my life. But anyway I want to have my app in a clean and consisting state before building, so that I can live with ext-all.js in case the production build becomes my nightmare. And of course I would also like to be able to build, now that I know by my eyes that it is a great thing (from my first, successful try). So that are my questions, how to have my app back without any dependencies of anything from the build folder, as it was after my first build, and how to overcome these obstacles and do a successful production build without affecting the original app creating dependencies to build output files. Excuse being this verbose but I wanted to point out my questions clearly.
    I spent some hours reading line by line all my app js files and adding any required and missing stuff to the "requires" sections, and also checking in the web console that there were no warnings or errors, actually there were no warnings or errors even before doing this. All my classes are Ext.define'd and all my objects created inline are Ext.create'd, and not using the new operator.
    Just a note, I can't imagine if it's related to this, I have a css file, included in the index.html file, and declared as remote in the app.json file, so that it doesn't get minified or bundled, and after building I can still easely change some colors.
    Can anybody give any opinion on these issues, give any idea or point to some resource?
    Thanks a lot for your reading.

  2. #2
    Sencha Premium Member richardvd's Avatar
    Join Date
    Jun 2011
    Location
    NL
    Posts
    255

    Default

    So you are getting a HTTP 404 error in production on a file named ".js". That looks to me like something is still missing in your requires arrays.

    I suggest to do a sencha app build testing and then look at the Javascript console when running your app, it may give you a helpful hint.

    Also, if you want to return to normal development mode after a testing or production build, I suggest running sencha app build development once.

  3. #3
    Sencha User
    Join Date
    Dec 2016
    Location
    Pinar del Rio, Cuba
    Posts
    9

    Default

    Thanks for your time richardvd. I did the testing build, and voila, there it was the viewport plugin missing! I required it, and builds started to be useful again. But regarding the uggly window I'm still stuck with that. And actually after doing a development build my app still loads MyApp-all_1.css and MyApp-all_2.css from .../build/development/MyApp/resources which make the window look bad. In the meantime I have to live overwriting these files with the old, good looking ones, and also with my fingers crossed wishing that they would not break any new code I have added to my app (I don't know how is this posible but so for it has been).

  4. #4
    Sencha Premium Member richardvd's Avatar
    Join Date
    Jun 2011
    Location
    NL
    Posts
    255

    Default

    Quote Originally Posted by Andro00 View Post
    after doing a development build my app still loads MyApp-all_1.css and MyApp-all_2.css from .../build/development/MyApp/resources
    It is supposed to do that, so does a freshly generated starter app. What did you expect?

    Likely, the cause of the bad looking windows problem is CSS related, but it is to be found elsewhere. Earlier you wrote about including your own CSS in index.html. I think it should not go there but only in app.json. First try without your own CSS, or maybe generate a new app and move over your Javascript classes and your custom CSS to the new project step by step.

    You may want to check out Fashion if you haven't already: https://www.sencha.com/forum/showthr...=1#post1167018

Similar Threads

  1. Replies: 18
    Last Post: 20 Apr 2017, 1:05 PM
  2. Replies: 8
    Last Post: 22 Jul 2015, 10:36 PM
  3. Replies: 4
    Last Post: 1 May 2015, 5:54 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •