You need to sign in to do that
Don't have an account?
Nick Butler
ltng:require does not work with lightning out
I can include an external resource in my component and it will work in salesforce. However it does not work when using the component in "lightning out".
For example. This is the correct way to include a static resource javascript library.
<ltng:require scripts="{!$Resource.FileSaver_js_zip + '/FileSaver.js-master/FileSaver.js'}" />
works just fine in salesforce.
using this component in "Lightning out". I get the error due to trying to pull in the static resource on the 'origin host' rather that my salefsorce org.
aura_proddebug.js:15863 GET https://{origin_host}/resource/1481801758000/FileSaver_js_zip/FileSaver.js-master/FileSaver.js 404 (Not Found)
Is there a work-around? If not this will be very limiting.
For example. This is the correct way to include a static resource javascript library.
<ltng:require scripts="{!$Resource.FileSaver_js_zip + '/FileSaver.js-master/FileSaver.js'}" />
works just fine in salesforce.
using this component in "Lightning out". I get the error due to trying to pull in the static resource on the 'origin host' rather that my salefsorce org.
aura_proddebug.js:15863 GET https://{origin_host}/resource/1481801758000/FileSaver_js_zip/FileSaver.js-master/FileSaver.js 404 (Not Found)
Is there a work-around? If not this will be very limiting.
You can try this
Due to a quirk in the way $Resource is parsed in expressions, use the join operator to include multiple $Resource references in a single attribute. For example, if you have more than one JavaScript library to include into a component the scripts attribute should be something like the following.
Did you find a solution for this? The solution mentioned in the above comment does not work for me when I am inside a lightning out app.