Lightning Message Service Limitations
Keep the following in mind when working with Lightning message service.
Lightning message service supports only the following experiences:
-
Lightning Experience standard navigation
-
Lightning Experience console navigation
-
Salesforce mobile app for Aura and Lightning Web Components, but not for Visualforce pages
-
Lightning components used in Experience Builder sites.
Lightning Message Service doesn’t work with Salesforce Tabs + Visualforce sites or with Visualforce pages in Experience Builder sites.
Lightning message service only supports Aura components that render. You can’t use lightning:messageChannel in an Aura component that uses the background utility item interface. Similarly, Aura components that use lightning:messageChannel can’t call Lightning Message Service methods in the init lifecycle handler because the component hasn’t rendered.
In a custom Aura component, lightning:messageChannel must be an immediate child of the aura:component tag. It can’t be nested in an HTML tag or another component.
For example, the following code renders without a problem.
This code throws an error when the Aura component tries to render.
If your component uses Lightning message service to publish a message, that message is constrained by any iframe boundary. To work around this limitation, use the sforce.one.subscribe() and sforce.one.unsubscribe() methods.
Do not usecreateComponent() to dynamically create a lightning:messageChannel component in Aura. Dynamically created components may not work as expected. For information on supported ways to create a lightning:messageChannel component, see Create a Message Channel.
See Also