You need to sign in to do that
Don't have an account?
Jeremy Benetz 8
I am having intermittent issues loading a static javascript resource using lightning:require.
I am using the Lodash and Moment javascript libraries, imported as static resources, in several lighting components. Most of the time they work great, but every so often I get an error like this in the UI:
Action failed: ltng:require$controller$init [ltng:require encountered an existing <script> element for /resource/SDS_LODASH_JS that was not created by an ltng:require instance. Unable to determine when the script would complete loading!]
I'm currently loading these libraries with the following tag:
Has anyone else had this problem and figured out how to resolve it?
Action failed: ltng:require$controller$init [ltng:require encountered an existing <script> element for /resource/SDS_LODASH_JS that was not created by an ltng:require instance. Unable to determine when the script would complete loading!]
I'm currently loading these libraries with the following tag:
<ltng:require scripts="{!join(',', $Resource.SDS_Moment_JS, $Resource.SDS_LODASH_JS)}" afterScriptsLoaded="{!c.doInit}"/>
Has anyone else had this problem and figured out how to resolve it?
May I suggest you please refer the below link for reference.
- https://salesforce.stackexchange.com/questions/158678/how-to-load-static-resources-in-lightning-components-from-zip-file
- https://developer.salesforce.com/forums/?id=9060G000000I49uQAC
hope it helps.Please mark it as best answer if the information is informative.so that question is removed from an unanswered question and appear as a proper solution.
Thanks
Rahul Kumar
I don't know if it's work mentioning but neither of my resources are zipped.