+ Start a Discussion
Sreekumar_MenonSreekumar_Menon 

Something has gone wrong. $Lightning is not defined. Please try again.

getting this error when trying to run a lighning app . If I remove the extends="ltng:outApp" , the error goes away. Any suggestions ?
-lightning is enabled in the org.
-extends ltng:outApp is required to include this in a VF page. 

<aura:application access="GLOBAL" extends="ltng:outApp">
    <!-- Define the Design System static resource (version 0.9.0) -->
    <c:scoryAppCard />
</aura:application>

any suggestions?
 
SalesforceLearnerSalesforceLearner
Hi Sreekumar I am also facing the same issue. Did you find solution for this ??
Sreekumar_MenonSreekumar_Menon
Inspite of this error when you run the lightning app, the lightning component works inside VF page.  could be a bug.

VF page code that embed the above lightning component -

<apex:page standardStylesheets="false" standardController="Account" showHeader="false" sidebar="false">
   
    <!-- Include a JavaScript file in your Visualforce page -->
    <apex:includeScript value="/lightning/lightning.out.js" />

    <div id="lightning" />

    <script>
    //Tell your Visualforce page to use ExposeVF Lightning app
        $Lightning.use("c:scoryApp", function() {
            // Write a function that creates the component on the page
          $Lightning.createComponent("c:scoryAppCard",
          {},
          "lightning",
          function(cmp) {
            // do some stuff
          });
        });
    </script>

</apex:page>


 
SalesforceLearnerSalesforceLearner
But for me it is showing nothing when I added component to the VF page.
 
<apex:page standardStylesheets="false" sidebar="false">

   <apex:includeScript value="/lightning/lightning.out.js" />
        <div id="lightning" />
       <div style="vertical-align: top; margin-top: -650px;">
          <script>
       
        $Lightning.use("c:AccountInfoApp", function() {
          $Lightning.createComponent("c:AccountInfoComponent",
          { Label : " " },
          "lightning",
          function(cmp) {
            // do some stuff
          });
        });
    </script>
    </div>

 
Sreekumar_MenonSreekumar_Menon
Anusha,
Can you post your c:AccountInfoApp app code? 
Sreekumar_MenonSreekumar_Menon
did you remove  extends="ltng:outApp"  from app? it should be there to get it working in VFP.
SalesforceLearnerSalesforceLearner
No I didn't removed.

Here is my app code :
 
<aura:application access="GLOBAL" extends="ltng:outApp" >

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

</aura:application>

 
Sreekumar_MenonSreekumar_Menon
try this-

<aura:application access="GLOBAL" extends="ltng:outApp" >

  <c:AccountInfoComponent />

</aura:application>
SalesforceLearnerSalesforceLearner
I tried your code but still it is not working :(
Sreekumar_MenonSreekumar_Menon
Hi,
Did you try running the lightning app outside VFP , to see if it is giving an output? 

remove access="GLOBAL" extends="ltng:outApp"  from your app and click update preview from app code-
 
<aura:application > <c:AccountInfoComponent /> </aura:application>

if it is still empty, check the browser's developer console for any JS errrors