Invalid page in communities

FYI, We tried to navigate to VF page from lightning component in community using navigateToURL. Logged in user as System Administrator.
But navigation failed and showing “Invalid page” error.

Here we enabled the below things : Available for Lightning Experience,
Lightning Communities, and the mobile app Enabled Visualforce Page

Here’s my code. Any advice/suggestions will be greatly appreciated.


<aura:component implements="forceCommunity:availableForAllPageTypes" access="global" >

    <lightning:button variant="brand" label="Navigate VF" onclick="{! c.navigateVF }" />


    navigateVF : function(cmp, event, helper) {
            "url": "/apex/NavigateUI" 


<apex:page >
    <button type="button" onclick="navigateBack()">
        navigate back
    <script type="text/javascript">
    function navigateBack() {
        console.log("navigate to previous");



I tried opening a visualforce page from my lightning component and it works for me.Why don’t you first try opening a visuaforce page in your community through your browser url to know it has required permission to be accessed in community.You can do it using following:

instanceurlofCommunity/namespace[if any]/apex/visualforce page.

Try removing ‘/s’ if you are not able to open the visualforce page above

this is the url which I get when I try to open the visualforce page in my community from lightning component:


I used the following and it works fine:

 navigateToVf : function(component, event, helper) {
            "url": "/apex/Map" 

Source : Link , Question Author : karthik , Answer Author : Isha

Leave a Comment