1

I was attempting to use the SFDX CLI to push the following file to a scratch org:

force-app>main>default>messageChannels>SettingCategory_Selected.messageChannel-meta.xml

<?xml version="1.0" encoding="UTF-8" ?>
<LightningMessageChannel xmlns="http://soap.sforce.com/2006/04/metadata">
    <masterLabel>SettingCategorySelected</masterLabel>
    <isExposed>true</isExposed>
    <description>Message Channel to pass a category</description>
    <lightningMessageFields>
        <fieldName>category</fieldName>
        <description>This is the Setup Category that changed</description>
    </lightningMessageFields>
</LightningMessageChannel> 

The push failed with the error:

force-app\main\default\messageChannels\SettingCategory_Selected.messageChannel-meta.xml
Error parsing file: The processing instruction target matching "[xX][mM][lL]" is not allowed. (2:6)

Why is it failing to push?

1

A closer look at the XML file makes the problem apparent:

XML file with empty lines before XML starts

There is an empty line / blank space before the XML prolog. Clearing out everything before the <xml version... resolved the somewhat cryptic error message.

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.