I built a lightning component to be used in a Visualforce page using Lightning Out, which works fine in my development environment, which is in Spring '18. However, when I pushed it to another environment, this one on the Summer '18 preview, I ran into an issue with my event handler override. The following code works on Spring '18 but only on Summer '18 when in debug mode.

If the user does not have access to the Apex controller, I get an error: This page has an error. You might just need to refresh it. Action failed: c:MyComponent$controller$navigateToOpportunity [Cannot read property 'recordId' of undefined] Failing descriptor: {c:MyComponent$controller$navigateToOpportunity}. Then if I give the user access, the page fails silently.

This follows the pattern from this previous question, and as I said, it works as expected both in Summer '18 debug mode and in Spring '18. Any idea of what exactly is going wrong? And any ideas for workarounds (other than enable debug mode for everyone) if this isn't resolved before Summer '18 is released?

Note: the Visualforce page is only meant to be used in SF Classic, hence only the window.location.href.

VF Page:

<apex:page id="MyPage">
    <apex:includeLightning />
    <apex:pageMessages />
    <div id="manager" style="width"></div>
        $Lightning.use("C:MyDependency", function () {
                , {
                    recordId: "{!$CurrentPage.parameters.opportunityId}"
                    , standalone: true
                , "manager"
                , function (component) {
                        event: "force:navigateToSObject",
                        handler: function(event) {
                            window.location.href = "/" + event.$params$.recordId;

Relevant code from controller:

navigateToOpportunity: function(component, event, helper){
    var navigationEvent = $A.get("e.force:navigateToSObject");
        "recordId": component.get("v.recordId"),

Button from component:

<lightning:button variant="neutral"
    label="Return to Opportunity"
    class="slds-m-around_small slds-float_left"/>

Dependency app:

<aura:application description="MyDependency" extends="ltng:outApp">
    <aura:dependency resource="c:MyComponent"/>
    <aura:dependency resource="markup://force:*" type="EVENT"/>
  • 1
    Salesforce lightning team... please don't break this as it's hard enough to get nav working in lightning out. May 22, 2018 at 23:23
  • 1
    I wonder if you are running into issues with the line event.$param$.recordId - you could just try event.getParam('recordId') perhaps they don't like your method of accessing the param. May 22, 2018 at 23:29
  • 1
    That worked! Man, I hate how there are always multiple ways to do the same thing in lightning, and then one breaks in a new release...
    – SFDC Neuf
    May 22, 2018 at 23:48

1 Answer 1


I wonder if you are running into issues with the line event.$param$.recordId

Try using event.getParam('recordId'). Perhaps the way you access the parameter is no longer supported.

  • Huh. Where did that $param$ syntax come from anyway??
    – Charles T
    May 23, 2018 at 2:47
  • I've seen it a couple of times. I don't think we'll be seeing it again ;) May 23, 2018 at 3:22

You must log in to answer this question.

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