Results 1 to 4 of 4

Thread: Links to resources broken after build

  1. #1
    Sencha Premium Member
    Join Date
    Apr 2013
    Location
    Bratislava, Slovakia
    Posts
    31
    Answers
    1

    Default Answered: Links to resources broken after build

    I have this line in my app's index.html:
    Code:
    <link href="resources/images/favicon.ico" rel="shortcut icon" type="image/x-icon" />
    This works fine when I open the app in browser while developing. However, after I run
    Code:
    sencha app build production
    that link remains unchanged (obviously). Thus the link becomes broken when opening the index file from the build directory. Sencha Cmd copied the icon to build/production/MyApp/modern/resources/images/favicon.ico

    I didn't find any good solution for this. I tried specifying "resources" in app.json - no luck, the image just gets copied to the above location.

    Is there any solution besides specifying an absolute URL to the favicon?

  2. Yes, it behaves as you describe. Although I can understand the rationale, mainly in the light of the fact that other resources are addressed relative to the css that refers to them, it's unlucky for favicon that is not addressed from a css.

    You can file it as a bug (or feature request) or you can copy the file manually.

  3. #2
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,664
    Answers
    512

    Default

    Sounds strange because resources are copied w/o changes from development to production. See the Network tab in developer tools what is the actual address from which Ext tries to load the favicon. It may give you a clue to what's happening.
    Jozef Sakalos, aka Saki

    Education, extensions and services for developers at new http://extjs.eu
    News: Grid MultiSearch Plugin, Grid MultiSort Plugin, Configuring ViewModel Hierarchy


  4. #3
    Sencha Premium Member
    Join Date
    Apr 2013
    Location
    Bratislava, Slovakia
    Posts
    31
    Answers
    1

    Default

    As you say, it is strange. I checked the file locations thoroughly. The original file is at
    MyApp/resources/images/favicon.ico

    Sencha Cmd copied it to
    build/production/MyApp/modern/resources/images/favicon.ico
    build/production/MyApp/classic/resources/images/favicon.ico

    I expected to see it at
    build/production/MyApp/resources/images/favicon.ico

    I checked the Network tab the first thing when I noticed the problem. The request for favicon is not showing up due to a known bug (not even in Firefox. Yes, I cleared the browser cache every time.). Nevertheless, the problem is replicable with any resource, such as resources/foo.js.
    Code:
    <script src="resources/foo.js" type="text/javascript"></script>
    Works well on MyApp/index.html but fails on build/production/MyApp/index.html. I get 404 for

    "https://localhost/build/production/MyApp/resources/foo.js"

    Instead, the file is to be found at "https://localhost/build/production/MyApp/modern/resources/foo.js"

    I should add I am using Sencha Cmd 6.0.0.154.

  5. #4
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,664
    Answers
    512

    Default

    Yes, it behaves as you describe. Although I can understand the rationale, mainly in the light of the fact that other resources are addressed relative to the css that refers to them, it's unlucky for favicon that is not addressed from a css.

    You can file it as a bug (or feature request) or you can copy the file manually.
    Jozef Sakalos, aka Saki

    Education, extensions and services for developers at new http://extjs.eu
    News: Grid MultiSearch Plugin, Grid MultiSort Plugin, Configuring ViewModel Hierarchy


Similar Threads

  1. Replies: 3
    Last Post: 20 May 2015, 2:18 PM
  2. Replies: 0
    Last Post: 9 Apr 2014, 10:38 AM
  3. Replies: 0
    Last Post: 26 Feb 2013, 5:16 PM
  4. Replies: 5
    Last Post: 16 Mar 2012, 5:47 AM
  5. links broken in 2.0 doc.
    By qiang in forum Community Discussion
    Replies: 2
    Last Post: 30 Oct 2007, 1:29 PM

Posting Permissions

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