2

I've got the requirement to prepare a page that will be displayed to users when the Community is inactive. I prepared a Visualforce page and set this as "Inactive Site Home Page" in the Setup > Sites > My Site configuration.

On this page I would like to display my c:ErrorPage aura component via c:ErrorPageApplication aura app.

InactiveSiteHomePage.page

<apex:page applyBodyTag="false" showHeader="false" sideBar="false">
    <apex:includeLightning/>
    <script>
        $Lightning.use(
            "c:ErrorPageApplication",
            function() {
                $Lightning.createComponent(
                    "c:ErrorPage",
                    {},
                    "lightningComponent",
                    function(cmp) {
                    }
                )
            }
        );
    </script>
    <div id="lightningComponent"></div>
</apex:page>

ErrorPageApplication.app

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

ErrorPage.cmp

<aura:component>
    Hello There
</aura:component>

The problem is that there is potentially an issue with loading the LIGHTNING OUT library on my Visualforce page when the Community is inactive.

GET https://xxx.xxx.force.com/c/ErrorPageApplication.app?aura.format=JSON&aura.formatAdapter=LIGHTNING_OUT 503 (Service Unavailable)

I found existing threads with similar but not exactly the same issue:

5
  • I assume, given your description, this is for a non-Lightning Community (Digital Experience) and that you therefore cannot use the Digital Experience Builder to create your page (to avoid use of VF)?
    – Phil W
    Jun 16 at 9:54
  • 1
    It's a Lightning Community but I found this: "For inactive sites, the default error page is the Under Construction page, and can’t be overridden using page assignments. You can override the default error page by assigning a simple HTML custom Visualforce page in the Inactive Site Home Page field." here: help.salesforce.com/…
    – Nobi992
    Jun 16 at 10:31
  • @Nobi992 Can you log a case with Salesforce Support and share the case number so I can take it forward?
    – Swetha
    Jun 18 at 10:55
  • 1
    @Swetha Here: Case 30260984
    – Nobi992
    Jun 21 at 10:59
  • I've got response from Salesforce Support: "I have checked internally and Lightning Out is not usable when a community is inactive. When the page then attempts to retrieve Lightning Out, it will receive a 503 error since the site is not up. This is expected, and working as designed. You might have to consider using just VF page. Please let me know if you need further information."
    – Nobi992
    Jun 21 at 12:25
1

Lightning apps currently require a user context, even if it's the guest user. But if the site and guest user are inactive, there's no user context for the inactive site page. Therefore it throws the 503 error which is currently working as designed behaviour. The workaround would be to use the VF page as mentioned in the Support case.

It would be a new feature request to support the functionality with Lightning out. Thank you for taking the time to log the Idea. I have shared it with the relevant team.

1

Salesforce confirmed that the reported issue is expected and working as designed.

I've created an idea to change that:

LIGHTNING OUT on VF set as "Inactive Site Home Page” when community is inactive

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.