[SalesForce] SOLVED – Communicate Between Unrelated Components – Trailhead- Error with LightningMessageChannel

Check the answer for the solution:

I'm working on the Communicate Between Unrelated Components module on Trailhead.

I'm stuck at step 1:

  1. In Visual Studio Code, in the default folder, create a folder named
    messageChannels.

  2. In the messageChannels folder, create a file named
    Count_Updated.messageChannel-meta.xml.

  3. In Count_Updated.messageChannel-meta.xml, paste this code:

That gives me this error:

cvc-elt.1.a: Cannot find the declaration of element 'LightningMessageChannel'.xml(cvc-elt.1.a)

How do I solve this?

Best Answer

This isn't a blocking error for that Trailhead, it's issued from VS Code. You'll be able to save and deploy it.
An extension of VS Code is trying to validate your xml and doesn't find the definition of that element.
If you want to disable it click on File menu, then on Preferences and open Settings. Search for 'xml validation' and disable it.

Related Topic