I am getting following error in console on load of a VF page that embeds lightning component.


Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://MYRDomain-dev-dev-ed--c.na30.visual.force.com') does not match the recipient window's origin 'https://MYRDomain-dev-dev-ed.my.salesforce.com').

VF Page:

<apex:page >
<script src="https://MYRDomain-dev-dev-ed.my.salesforce.com/lightning/lightning.out.js" />
<apex:includeLightning />

    <div id="lightning" />

$Lightning.use("c:UserPageApplication", function() {
                               function(cmp) {
                                   //do something

1 Answer 1


You don't need your script: <src="https://MYRDomain-dev-dev-ed.my.salesforce.com/lightning/lightning.out.js" />

Remove it and keep the <apex:includeLightning /> one, this will be enough to make Lightning Out work.

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.