function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ken KoellnerKen Koellner 

Add lightning app to visualforce page in winter '16 sandbox.

I'm working for these instructions -- https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/components_visualforce.htm

I'm trying to get this to work.  My SB in on Winter '16.  I'm getting a 404 on my aura component (I have firebug on my browser) in the firebug console.

This is KKTestApp1.app --
<aura:application access="GLOBAL" extends="ltng:outApp"> 
  <aura:dependency resource="ui:button"/>
</aura:application>
This is KKTestLightningContainer.vfp --
<apex:page>
    <apex:includeLightning />
     This is a test.
    <div id="lightning" />

    <script>
        $Lightning.use("hmhco:KKTestApp1", function() {
          $Lightning.createComponent("ui:button",
          { label : "Press Me!" },
          "lightning",
          function(cmp) {
            // do some stuff
          });
        });
    </script>
</apex:page>


I tried including our domain "hmhco:KKTestApp1", leaving it out "KKTestApp1", and just "c" as in the example "c:KKTestApp1".

I'm my firebug console, I get 404 error on the URL --
 https://hmhco--sb2.cs42.my.salesforce.com/hmhco/KKTestApp1.app?aura.format=JSON&aura.formatAdapter=LIGHTNING_OUT
or --
https://hmhco--sb2.cs42.my.salesforce.com/c/KKTestApp1.app?aura.format=JSON&aura.formatAdapter=LIGHTNING_OUT"
or --
https://hmhco--sb2.cs42.my.salesforce.com/KKTestApp1/undefined.app?aura.format=JSON&aura.formatAdapter=LIGHTNING_OUT"


Maybe I need a different prefix.

Maybe there is some global setting to turn something on and make it available.

I'm working for these instructions -- https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/components_visualforce.htm

There's no additional info on anything that has to be done.
Ken KoellnerKen Koellner
I tried pretty much the same thing in my dev org.  I did get the button appearing in my VF page.  So it looks like it works when not served by a sandbox.  Of course that's pretty much useless for real development but I guess that's why they call it beta.

Page--
<apex:page>
    <apex:includeLightning />
     This is a test.
    <div id="lightning" />

    <script>
        $Lightning.use("learn2turn:KKTestApp1", function() {
          $Lightning.createComponent("ui:button",
          { label : "Press Me!" },
          "lightning",
          function(cmp) {
            // do some stuff
          });
        });
    </script>
</apex:page>

App-
<aura:application access="GLOBAL" extends="ltng:outApp"> 
 <aura:dependency resource="ui:button"/>
</aura:application>

 
Ken KoellnerKen Koellner
(The <b> </b> in the code above is just the result of a copy and paste.  The tring really is "hmhco:KKTestApp1".
Christian Szandor KnappChristian Szandor Knapp

Hey Ken,

I have been experiencing exactly the same issue and have tried contacting doug chasman about them over @ stackexchange in a similiar thread:

http://salesforce.stackexchange.com/questions/97840/lightning-out-for-visual-force-in-a-community-works-in-dev-org-but-fails-in-sand/99206?noredirect=1#comment148829_99206

Kind Regards,

Sz