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
KevinsanKevinsan 

Cannot read property 'la' of undefined

I try to use overlayLibrary for popover action.
Get the error message below, can anyone help?
"Cannot read property 'la' of undefined"
<aura:component >    
    <lightning:overlayLibrary aura:id="overlayLib"/>
    <lightning:button name="popover" label="Show Popover" onclick="{!c.handleShowPopover}"/>    
    <div class="mypopover" onmouseover="{!c.handleShowPopover}">Popover should display if you hover over here.</div>
</aura:component>

// Controller
({
    handleShowPopover : function(component, event, helper) {
        component.find('overlayLib').showCustomPopover({
            body: "Popovers are positioned relative to a reference element",
            referenceSelector: ".mypopover",
            cssClass: "popoverclass"
        }).then(function (overlay) {
            setTimeout(function(){ 
                //close the popover after 3 seconds
                overlay.close(); 
            }, 3000);
        });
    }
})

// app
<aura:application >
    <c:Popover_OneStop />
</aura:application>


 
Best Answer chosen by Kevinsan
Raj VakatiRaj Vakati
lightning: overlayLibrary is not supported in the lightning application. It's supported only on salesforce lightning experience Lightning, Console, Communities .


If you wanted to test it create a component tab or add the component to the lightning experience and test and it not with the app 

All Answers

Raj VakatiRaj Vakati
lightning: overlayLibrary is not supported in the lightning application. It's supported only on salesforce lightning experience Lightning, Console, Communities .


If you wanted to test it create a component tab or add the component to the lightning experience and test and it not with the app 
This was selected as the best answer
Raj VakatiRaj Vakati
fot testing craete a component tab and test it . becuase lightning:overlayLibrary  is not supported app 

 
KevinsanKevinsan
Hi RajV,
Thank you for you explanation.
I found the support infomation on official developer guide (https://developer.salesforce.com/docs/atlas.en-us.212.0.lightning.meta/lightning/ref_lightning_overlayLibrary.htm)