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
Raghu Natha 2Raghu Natha 2 

lightning out component guess access on external application


Hi,

I am trying to use Lightning out component out side salesforce, and I see the below error in the browser console.
" GET  https://rnrcommunities-developer-edition.na85.force.com/Test//c/lwcVfDemoApp.app?aura.format=JSON&aura.formatAdapter=LIGHTNING_OUT 404 (Not Found)"

Below is the code

<html>
<H1> Hello World </h1>
<div id="lightning"></div>
<script src="https://rnrcommunities-developer-edition.na85.force.com/Test/lightning/lightning.out.js"></script>
<script>
$Lightning.use("c:lwcVfDemoApp", function() {
$Lightning.createComponent("c:lwcVFDemo", {
objectName: "Contact"
},
"lightning",
function(cmp) {
console.log("LWC component was created");
// do some stuff
}
);
},
'https://rnrcommunities-developer-edition.na85.force.com/Test/'
);
</script>
</html>

NOTE: this is for allowing gues access.
lnallurilnalluri
Hi Raghu,

Can you share your lwcVfDemoApp 

OR 

Make sure you are using ltng:allowGuestAccess interface in your app.
Similar to 
<aura:application access="GLOBAL" extends="ltng:outApp" 
    implements="ltng:allowGuestAccess"> 
    <aura:dependency resource="c:storeLocatorMain"/>
</aura:application>
Raghu Natha 2Raghu Natha 2
Hi Nalluri, 

Below is my code.

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

 
lnallurilnalluri
@Raghu,

Checkout this thread. https://salesforce.stackexchange.com/questions/96368/lightning-components-in-visualforce

 
Raghu Natha 2Raghu Natha 2
Hi Nalluri,

Thank you for the replies, I am able to get the component working on a VF page in SF Org.
But unsuccessfull in running the same component outside SF.

The link that was shared above is more of for an VF Page.