I'm creating an LWC to be embedded in a Visualforce page to be shown in a Public Force.com Site following the documentation:


However the component doesn't load and the Javascript Console indicates the following error

    "event": {
        "descriptor": "markup://aura:invalidSession",
        "attributes": {
            "values": {}
        "eventDef": {
            "descriptor": "markup://aura:invalidSession",
            "t": "APPLICATION",
            "xs": "I",
            "a": {
                "newToken": ["newToken", "aura://String", "I", false]
    "exceptionEvent": true

Maybe I'm missing something or is directly not possible to use LWC embedded in Visualforce in Public Sites since there's not a real existing session.



    <div id="lightningvf" />

    <apex:outputPanel layout="none" rendered="{!individualId != null}">
            $Lightning.use("c:myLwcCompAuraApp", function() {
                    { recordId : "{!contactId}" },
                    function(component) {}

Aura App

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





import { LightningElement, api } from 'lwc';

export default class MyLwcComp extends LightningElement {
    @api recordId;
  • Seems like you've done everything right... maybe simplify even further by testing using a standard component like in the example and perhaps removing the output panel? Mar 2, 2020 at 17:45
  • Same error shows up when firing an apex imperative call from callback of an streaming api subscription. https://salesforce.stackexchange.com/questions/314515/lwc-apex-from-emp-api-callback-firing-dispatch-event-or-an-apex-call-from-st. @jonathanwiesel Did you get any answer for this. Aug 2, 2020 at 9:55
  • 1
    @NagendraSingh I'm afraid not =(, I've abandoned thw approach Aug 2, 2020 at 18:46

1 Answer 1


I had a exactly same issue... And I solved it including ltng:allowGuestAccess in Aura App. Like this:

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .