Results 1 to 4 of 4

Thread: SASS get-resource-path generates/permits extra / separator

    You found a bug! We've classified it as EXTJS-19630 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Touch Premium Member
    Join Date
    Sep 2011
    Posts
    99

    Default SASS get-resource-path generates/permits extra / separator

    Ext version tested:
    • Ext 6.0.1
    Browser versions tested against:
    • Chrome 45.0.2454.101 m
    Description:
    • SASS generates extra / between resources and fonts.
    Steps to reproduce the problem:
    • Install Cmd 6.0.2.14
    • Install Ext-6.0.1
    • Generate an app
    • Build the app
    • Run the app
    • Look in Chrome Dev Tools Source tab under build/development/myapp/modern/resources
    • in myapp-all.css search for resources//fonts (double /)
    The result that was expected:
    • resources/fonts (single /)
    The result that occurs instead:
    • resources//fonts
    The problem seems to be coming from \ext\classic\theme-triton\sass\src\ Component.scss which contains:
    Code:
    $triton-font-path: get-resource-path('fonts', 'shared');
    Which is then used a number of places as:
    Code:
    @font-face {
        font-family: 'Open Sans';
        src: url('#{$triton-font-path}/OpenSans-Light.ttf');
        font-weight: 300;
        font-style: normal;
    }
    get-resource-path is defined in ext-6.0.1\sass\etc\all.scss and uses $current-resource-root. So the problem might be:
    • the fact that the value of $current-resource-root ends in a /,
    • file_join should be checking for extra /'s. (Although maybe it should not care.)
    • get-resource-path should remove the trailing /
    This problem does not show up with Cmd Jetty-based web server which ignored the extra /, but it did show up with the Visual Studio Development Server which refused to process the extra / and threw a 404 error.

  2. #2
    Sencha - Support Team bjdurham85's Avatar
    Join Date
    Mar 2014
    Posts
    962

    Default

    Thanks for the report! I have opened a bug in our bug tracker.

  3. #3

    Default

    Is there a workaround for this bug? I'm seeing it on an android build: GET /android_asset/www/resources//fonts/OpenSans-Semibold.ttf gives "net::ERR_FILE_NOT_FOUND"

  4. #4

    Default

    The problem is that $current-resource-root is empty string when Open Sans font path is calculated in get-resource-path function in ext-6.0.1\sass\etc\all.scss file. So $prefix will be empty string after this:

    Code:
    $prefix: $current-resource-root;


    and

    Code:
    $prefix: file_join($val, $prefix);
    - (line 19)

    will append a slash to the resource path and

    Code:
    $leaf: file_join($prefix, $path);
    - (line 28)

    will append '/fonts' to the resource path. Result is double slash between 'resources' and 'fonts'

    A workaround could be to check $prefix and join only if it's not empty. So changing

    Code:
    $prefix: file_join($val, $prefix);
    - (line 19)

    to

    Code:
    $prefix: if($prefix, file_join($val, $prefix), $val);
    can help.

Similar Threads

  1. [OPEN] Copy extra resource to production - CMD 6
    By fabio.policeno in forum Sencha Cmd
    Replies: 9
    Last Post: 24 Apr 2017, 11:26 PM
  2. How to add sass resource?
    By ssamayoa in forum Sencha Architect 3.x: Q&A
    Replies: 0
    Last Post: 3 Mar 2014, 2:04 PM
  3. Replies: 17
    Last Post: 29 Jun 2011, 2:33 PM
  4. Replies: 2
    Last Post: 19 Dec 2010, 9:53 PM
  5. Menu separator extra space in IE7
    By bahar in forum Ext 1.x: Bugs
    Replies: 1
    Last Post: 17 Apr 2007, 1:02 PM

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
  •