Check the answer for the solution:
I'm working on the Communicate Between Unrelated Components module on Trailhead.
I'm stuck at step 1:
-
In Visual Studio Code, in the default folder, create a folder named
messageChannels. -
In the messageChannels folder, create a file named
Count_Updated.messageChannel-meta.xml. -
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 onPreferences
and openSettings
. Search for 'xml validation' and disable it.