You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just configured a LWC to work with an Object and I got this error. The configuration is fine and it is deployable to a Salesforce org. It is just the vscode extension that complains about it.
Below you can see the valid lwc xml config
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundlexmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>52.0</apiVersion>
<isExposed>true</isExposed>
<targets>
<target>lightning__RecordPage</target>
</targets>
<targetConfigs>
<targetConfigtargets="lightning__RecordPage">
<propertylabel="Height"name="height"type="String"default="500px"description="Adjust this value to change the Height. If you clean this value, it defaults to 100%."/>
<propertylabel="Width"name="width"type="String"default=""description="Adjust this value to change the component's Width. If you clean this value, it defaults to 100%."/>
<objects>
<object>WorkOrder</object>
</objects>
</targetConfig>
</targetConfigs>
</LightningComponentBundle>
This is the error message when hovering over the indicated error:
Invalid element name:
- objects
One of the following is expected:
- property
- propertyType
- supportedFormFactors
Error indicated by:
{http://soap.sforce.com/2006/04/metadata}
with code:xml(cvc-complex-type.2.4.a)
Limits the component to a set of one or more objects. If you don’t use this tag set, the component supports all supported objects. This tag set works only inside a parent targetConfig that’s configured for lightning__RecordPage. Specify the objects tag set only once inside a targetConfig set. Supports the object subtag
Steps To Reproduce:
Configure a "targetConfig" with an "Object", like the one below:
<targetConfigs>
<targetConfigtargets="lightning__RecordPage">
<propertylabel="Height"name="height"type="String"default="500px"description="Adjust this value to change the Height. If you clean this value, it defaults to 100%."/>
<propertylabel="Width"name="width"type="String"default=""description="Adjust this value to change the component's Width. If you clean this value, it defaults to 100%."/>
<objects>
<object>WorkOrder</object>
</objects>
</targetConfig>
</targetConfigs>
Expected result
This error message should not appear
Actual result
There is a wrong error message appearing when configuring a LWC to work with an Object.
Summary
I just configured a LWC to work with an Object and I got this error. The configuration is fine and it is deployable to a Salesforce org. It is just the vscode extension that complains about it.
Below you can see the valid lwc xml config
This is the error message when hovering over the indicated error:
Steps To Reproduce:
Expected result
This error message should not appear
Actual result
There is a wrong error message appearing when configuring a LWC to work with an Object.
Additional information
SFDX CLI Version: sfdx-cli/7.94.3-a4e7c7955b win32-x64 node-v14.15.4
OS and version: windows 10
The text was updated successfully, but these errors were encountered: