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
Diederik VerstraeteDiederik Verstraete 

Live Agent and Lightning Component on same external page (lighting out)

We have build a lightning component that we placed on a Wordpress website via Lighting out ($Lightning.use).
This component is called AF_App (and AF_Main).

Now, we want to include a Live Agent standard component snippet on the same page from Service Cloud.
When we place both snippets on the same place we get following error:

Uncaught (in promise) Error: $Lightning.use() already invoked with application: c:AF_App

You can find everything back on this page:
https://kmo.attentia.be/blank-page-talent-peaks/
in the middle my component ( a screen flow build in apex/aura) and floating you see the "Chat with an expert" button

Use developer console to see the error.

AnudeepAnudeep (Salesforce Developers) 
Hi Diederik, 

As per the developer guide "Use Lightning Components in Visualforce Pages" https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/components_visualforce.htm

You can call $Lightning.use() multiple times on a page, but all calls must reference the same Lightning dependency app

Please check if you are using more than one Lightning dependency app on a page. If yes, you can try something like this

https://salesforce.stackexchange.com/questions/227091/any-possible-to-have-multiple-lightning-apps-on-a-visualforce-page

If this answers your question, please mark this as Best Answer so that it can help others in the future. Thank You!
 
Andries.NeyensAndries.Neyens
we managed to get this to work by using the same app as the live chat:
$Lightning.use("embeddedService:sidebarApp", function()