[SalesForce] LWC – error adding a targetConfigs into metadata (The ‘targetConfig’ tag doesn’t support text.)

I have the following js-meta.xml file for a lightning component. When I save this I get an error:

The 'targetConfig' tag doesn't support text.

What is the solution for this?

<?xml version="1.0" encoding="UTF-8"?>
    <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
        <apiVersion>47.0</apiVersion>
        <isExposed>true</isExposed>
        <targets>
            <target>lightning__RecordPage</target>
            <target>lightning__FlowScreen</target>
        </targets>
        <targetConfigs>
            <targetConfig targets="lightning__FlowScreen">​
                <property name="recordId" label="Record Id" type="String" />
            </targetConfig>
        </targetConfigs>
    </LightningComponentBundle>

Without the targetConfigs node there are no problems.

Note: What I'm trying to do is take an existing working component from a Record page and allow it to be run from within a flow. I believe I need to pass in the recordId to the component to get the data wired correctly.

Best Answer

Annoyingly(?) the answer was to retype the metadata from scratch - the same format and parameter names, etc... worked so may have been an issue with copy/paste into VSCode from the net.

Related Topic