8

I'm using Lightning Out in order to render my Lightning Components inside a Visualforce page.

<apex:page showHeader="true" sidebar="true">
  <apex:includeLightning />

  <div id="lightning" />

  <script>
      $Lightning.use("c:MyLightningOutApp", function() {
        $Lightning.createComponent("c:myComponent",
        {},
        "lightning",
        function(cmp) {}
        );
      });
  </script>
</apex:page>

Since I'm creating a Managed Package, my hope was that I would be able to use this approach to save on development time, while still allowing my subscribers to use the package in Salesforce Classic.

However, it seems that my Visualforce page is not able to render out Lightning Components without setting up the "My Domain" first on the subscriber's org. So, my question is, is there a way to use Lightning Out without setting up "My Domain"?

4

No. Lightning component won't work without setting my domain.

There are many reasons that My Domain is required and lightning component will not work unless you set a domain.

Useful link - Knowledge Article - My Domain Lightning Components

  • Thanks for your answer. I was aware of this requirement for Lightning Components, but I was hoping that there was some way to get around this when using Lightning Components inside Lightning Out. – smukov Jun 14 '17 at 18:54
  • No. Eventually you are using lightning component itself in your lightning out app, so you have to set up the domain. – Mustafa Jhabuawala Jun 17 '17 at 18:54

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.