[SalesForce] Not able to display Lightning component in Sites

Based on latet Spring 17 release notes,

I am trying to display lightning component in sites. I have a sample lightning component, visualforce page showing the component and a public site. Visualforce page is added to the site. When I preview the site as admin, nothing is shown on the visualforce page and it is blank.

Below is my sample


<aura:application access="GLOBAL" extends="ltng:outApp" implements="ltng:allowGuestAccess">
    <aura:dependency resource="c:mySampleComponent"/>


<aura:component >
    <ui:outputText value="This is a sample lightning component" />        

Visualforce Page

<apex:page showHeader="false" sidebar="false">
    <apex:includeLightning />

    <div id="lightningComp"/>
        $Lightning.use("c:mySampleApp", function() {
          { },
          function(cmp) {
            // do some stuff
        },'SITE URL GOES HERE'




Any insight on this would be very helpful.

Best Answer

You will need to enable Salesforce communities to get it working .The docs clearly mentions that for lightning out to work for guest users you need Salesforce communities enabled .

Also any error will show up in browser console .Open console and look for errors .

Related Topic