3

I have run into a large blocker regarding the use of Lightning Out to inject a Lightning component into a Visualforce page. I have used the method outlined in the documentation here in order to load a Lightning component in the classic service console.

The code I am using to inject the component is below:

<apex:page standardController="Case" showHeader="false" sidebar="false">

    <apex:slds />
    <apex:includeLightning />
    <apex:includeScript value="/support/console/40.0/integration.js"/>

    <style>
        .slds-form-element__label {
            font-size: 0.8125rem !important;
        }
    </style>
    <body class="slds-scope">
        <!-- Page div used to inject Lightning component -->
        <div id="assetManagerDiv"></div>
    </body>
    
    <!-- Script that uses the Lightning javascript library to inject a lightning component into the VF page div -->
    <script type="text/javascript">
        (function() {
            // Script to inject Lightning component into the Visualforce page
            $Lightning.use("c:AttachAssetToCaseEditorApp", function() {
                $Lightning.createComponent("c:AttachAssetToCaseEditorCmp",
                                            {
                                                "tabId" : '{!$CurrentPage.parameters.Id}'
                                            },
                                            "assetManagerDiv",
                                            function(component) {});
            });
        }());
    </script>
    
</apex:page>

I have used this method many times before and it has worked successfully. However, when I try to load the Lightning component in the Firefox browser I receive the following error in the browser console and the Lightning component will not load at all:

SecurityError: The operation is insecure - aura_proddebug.js:23749

TypeError: $A.initAsync is not a function - lightning.out.delegate.js:126:10

This is only happening in Firefox. It is working fine in the Chrome browser. I am using the current 55.0.3 64-bit version of Firefox.

Is there some issue with Firefox and Lightning Out that is currently happening? I am not sure how to figure out what is causing this issue.

  • Did u make sure c:AttachAssetToCaseEditorApp extends="ltng:outApp"? – Ravi Jayaramappa Sep 27 '17 at 23:10
  • @RaviJayaramappa Yes it does extend. Otherwise, I don't think it would work in Chrome either. I am looping back around to this issue because I am experiencing it again now. – Daniel Fuller Jan 8 '18 at 21:39
  • did you added dependency in your app <aura:dependency resource="c:AttachAssetToCaseEditorApp"/> – Manjot Singh Jan 9 '18 at 5:33
  • please include the lightning app and component codes. – A.Bretto Jan 9 '18 at 11:36
  • @DanielFuller Please provide the complete markup, controller code for your lightning components to repro this issue. A simpler repro, if possible, would be easier to diagnose the issue. Also, please log a Salesforce case to help you track the issue. – Ravi Jayaramappa Jan 9 '18 at 19:27
2

I found the solution for this issue. Somehow, there was an issue in the Firefox browser cache that was conflicting with Lightning Out. I cleared my Firefox browser cache and that resolved the issue. I'm not sure what in the cache was the culprit, however.

| improve this answer | |

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.