1

I have an static resource name CustomHelperJS, which is a javascript and is public. In my application i have this :

 <aura:application access="GLOBAL" extends="ltng:outApp" >
     <ltng:require styles="{!$Resource.SLDS202_HV1 + '/assets/styles/salesforce-lightning-design-system.min.css'}"
              scripts="{!$Resource.CustomHelperJS}" />

   <aura:dependency resource="c:LC01_GeneratePlainLayout"/>

when I include this app in my vf page and load it, the css apply well, but i obtain an error on my page :

   Uncaught TypeError: Cannot read property 'apply' of undefined throws at https://xxxoffice--agsdev--c.cs5.visual.force.com/auraFW/javascript/S8McHzEoUFAXrY8PUJ5Khw/aura_prod.js:499:85
 </aura:application>

My js file has not been loaded. I cannot refer to any js method i defined in that file. It gives me error, stating that the method does not exist.

Has anyone encounter problems with referencing a js file stored as a single static resource in lightning components ?

1
  • Does your component run properly in a standalone app? Commented Aug 11, 2016 at 15:54

1 Answer 1

0

I got it to load correctly. In fact it loaded my JS file correctly , but my JS file started with the script tag inside it. So the lightning component didn't like it :

 <script type="text/javascript"> 
    ......
    .....
    ......
 </script>
1
  • i can't accept it right now....i only can tomorrow... Commented Aug 12, 2016 at 7:29

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.