I've just moved some logic from one LWC into a "headless" @api invoke() LWC that is configured as an Action that appears as a button in the standard "Highlights Panel" LWC. The method is called, but the LMS message does not make it to the subscribing components.

This documentation says:

... you can take advantage of all of the great services provided in the LWC framework. For example you can use Lightning Data Services to get data from Salesforce, you can use Apex to perform complex operations and you can use Lightning Navigation Service to navigate to other pages in Salesforce.

and this documentation

... communicate across the DOM between Visualforce pages, Aura components, and Lightning web components, including components in a pop-out utility bar.

Reading this Define the Scope of the Message Service hasn't answered this question for me, and no joy Googling so far. Oh and the description of APPLICATION_SCOPE there isn't clear for me.

Some debugging revealed (first value is messageContext, second value is messageChannel__default['default']):

// For the action LWC publish

// For a component in the flexi-page body publish

// For a second component in the flexi-page body publish

so no obvious difference there.

I assumed that LMS should work in this context and the problem is something I've messed up on. But now I'm not so sure. Can anyone confirm?

1 Answer 1


Yes, Lightning Message Service (LMS) does work from a Lightning Web Component Action. The APPLICATION_SCOPE does not necessarily have to be set.

(My problem was that a component I had removed from the UI at the same time contained the subscriber. This code was written by someone else, and the subscriber component being "hidden" within the component I removed was a surprise to me.)

  • Really glad it was user error rather than a product limitation :)
    – Phil W
    Oct 11, 2021 at 9:04
  • 1
    Yeah @PhilW me too. One of those cases where nothing in the docs so that added a bit of uncertainty.
    – Keith C
    Oct 11, 2021 at 9:19
  • Is there a way to go around the requirement to have a Lightning Web Component Action? For example I want to pass a simple string state value each time it has changed. Jan 30 at 13:26
  • Will it work on change or focus events for example? Jan 30 at 13:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .