3

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.

2
  • Try using a different property name than the standard recordId parameter
    – Raul
    Dec 10, 2019 at 20:28
  • Sadly still same error with 'lorem' as the parameter name. Will try rebuilding meta file from scratch and also try with another component to see if I can get it to work. Dec 10, 2019 at 20:56

4 Answers 4

3

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.

0

Try adding default="{!recordId}" to the tag's directives

<targetConfigs>
    <targetConfig targets="lightning__RecordPage">
        <property
            name="recordId"
            type="String"
            label="Record Id"
            description="Automatically bind the page's record id to the component variable"
            default="{!recordId}" />
    </targetConfig>
</targetConfigs> 
0

Just Refresh the visual studio code by using command " workbench.action.reloadWindow ", that will resolve your issue.

0

If you have copy pasted from developer guide, you would find a junk character in this line, espcially in the end - so try removing > and type again. You can also check from https://www.textmagic.com/free-tools/unicode-detector (atleast I found the junk character using this tool)

<targetConfig targets="lightning__FlowScreen">​

You must log in to answer this question.

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