Saturday, July 6, 2019

Lightning Web Components (lwc) Are Not Showing in SF While Adding To Layout

Even after pushing the lighting web components into sf ,if it's showing in components list but not showing while adding to any layout ,it means your .js-meta.xml file has some issue.

Please check whether <targets> is specified for this component or not.Targets is nothing but where are in places this component can be accessible/usable like App page ,Record detail page or in home page layout.

Proper js-meta.xml will be like

<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="SalesforceSampleLWC">
<apiVersion>46.0</apiVersion>
<isExposed>true</isExposed>
<targets>
<target>lightning__AppPage</target>
<target>lightning__RecordPage</target>
<target>lightning__HomePage</target>
</targets>
</LightningComponentBundle>

Hope this helps you...Enjoy!

No comments: