6

After updating from winter 17 to spring 17 I am facing random issues with $Resource variable. This issue is observed:

  • Chrome
  • Firefox
  • Edge

and to my surprise everything works smoothly in IE11.

Issue Description:

  • I am using $Resource variable extensively to reference the resource prefix in stylesheet, script and image tags

  • Till Winter 17 everything works fine, but after upgrade it randomly started throwing 404 resource not found exception

  • When dived deeper it looks like "{!$Resource.zip_file}/Images/test.png" was resolved to "/Images/test.png" instead of "/resource/zip_file/Images/test.png"

Source:

<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
    <div>
        With $Resource: <br/>
        <img src="{!$Resource.prmsf__Pramata+'/Images/powered-by-pramata-logo.png'}" width="300"/>
    </div>
    <hr/>
    <div>
        With /resource: <br/>
        <img src="/resource/prmsf__Pramata/Images/powered-by-pramata-logo.png" width="300"/>
    </div>
</aura:component>

In Winter 17:

enter image description here

In Spring 17:

enter image description here

Note:

  • This is observed consistently when the Cache Buster is enabled in chrome
  • Currently I modified the code to /resource instead of $Resource but I am curious to know long term fix since documentation doesn't support the former

enter image description here

3
  • 1
    Sounds like a bug... I guess that's another one we need to report...
    – sfdcfox
    Jan 11, 2017 at 1:42
  • 3
    the known issues list with spring 17 is growing.. Jan 11, 2017 at 1:55
  • For all the fuss made about unit tests in Apex and the 'hammer', you'd think it'd be part of Lightning by now...
    – Matt Lacey
    Jan 16, 2017 at 23:39

1 Answer 1

6

As Doug Chasman answered on this question there is an issue with static resources in Spring'17. The issue is being tracked in R&D by W-3615844

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .