function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AnupamAnupam 

Lightning web component not showing in lighting home or app page

Hi 

I am following the lighting web component trailhead (https://trailhead.salesforce.com/content/learn/projects/quick-start-lightning-web-components/create-a-hello-world-lightning-web-component ).
I created the web component, but when i try to add it to the home component, the custom web component is not showing and cannot add it to the home page. The helloworld.js-meta.xml file is same as what metioned in the trailhead account.
I am doing this in my trailhead playground. Any help on this will be highly appreciated
Best Answer chosen by Anupam
Khan AnasKhan Anas (Salesforce Developers) 
Hi Anupam,

Greetings to you!

+1 @Raj

Please make sure you are using the latest version of salesforcedx. To work with Lightning web components, you need version 45 or greater of the Salesforce CLI. Check the installed version.

sfdx plugins --core

NOTE: If you had a prerelease version of the CLI installed, run this command to update it.
sfdx plugins:install salesforcedx@latest

You can see these components in your org using the tooling API query from the dev console. Check the tooling checkbox in the dev console.
The below query should show you if your org has these components:
Select Id from LightningComponentBundle
Select Id from LightningComponentResource

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas 

All Answers

AnupamAnupam
This is the lighting page screenshot
Raj VakatiRaj Vakati
You need to use the  js-meta.xml file as show below and push the changes 

Refer this links 

https://rajvakati.com/2018/12/22/lightning-web-components/ 


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

 
Raj VakatiRaj Vakati
Set isExposed --> True 
Target --> lightning__HomePage
 
Khan AnasKhan Anas (Salesforce Developers) 
Hi Anupam,

Greetings to you!

+1 @Raj

Please make sure you are using the latest version of salesforcedx. To work with Lightning web components, you need version 45 or greater of the Salesforce CLI. Check the installed version.

sfdx plugins --core

NOTE: If you had a prerelease version of the CLI installed, run this command to update it.
sfdx plugins:install salesforcedx@latest

You can see these components in your org using the tooling API query from the dev console. Check the tooling checkbox in the dev console.
The below query should show you if your org has these components:
Select Id from LightningComponentBundle
Select Id from LightningComponentResource

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas 
This was selected as the best answer
AnupamAnupam
Thank you all !!

Queried the lightning resource and found that there was issue in the meta xml file which was not stored correctly. Corrected the file and now it showing under home page component.

Now i have added the component to the home page but while validating the challenge i am getting below error :
Step not yet complete in My Trailhead Playground 2
Make sure you add the 'helloWorld' Lightning web component to the default Home page.
AnupamAnupam
I resolved this by doing on the system default home page. Earlier i was doing it by creating the custom home component.
Phoenix SPhoenix S
**Update 12/2019**

In case someone is just getting to this thread like I am here's what I had to do to get the LWC to show up on my app & pass the challenge:

1. Copy the code as listed
2. When you get to the part where you're ready to add the component to the page click the option to "Delopy to my Domain" (this may not be the exact verbiage)
3. Set your domain name. *NOTE: Choose wisely because domain names cannot be changed except through Salesforce Support*
4. Once your domain is active click "Login" to test out the domain
5. Deploy the domain to your users
6. Go back to the "Sales" app and edit the page adding your lightning web component as instructed
7. Verify the challenge and get the points and badge :)

I hope this helps! 
Efren Maldonado 13Efren Maldonado 13
Lightning Componets, Aura or LWC, require My Domain activated: https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/intro_reqs_my_domain.htm
{tushar-sharma}{tushar-sharma}
You can check the below links for multiple components. https://newstechnologystuff.com/2018/12/16/lightning-web-component-the-new-development-style/  This also has step by step guide to creating your first component and display on UI.
DarshanaDarshana
Hi Team,
I am stuck on this module. Module name: Create a Hello World Lightning Web Component.
 
I have created helloWorld LWC as instructed and deployed in org, but LWC is not showing in the app builder. I have checked below all possible scenarios.
1. Domain deployed - Yes it is
2. <isExposed>true</isExposed> - Yes
 
Please find attached screenshot and guide me where I need to correct them.
User-added image
Mausam Padhiyar 8Mausam Padhiyar 8

I was facing the similar issue. LWC - helloWorld was not visible in App Builder.

I tried all below even tough:
1. <isExposed>true</isExposed> was done in js-meta.xml file
2. LWC was deployed to the Org also i.e. Setup > Custom Code > Lightning Component
Actual Issue was My Domain. I was seeing "Deploy My Domain" to see custom component in App Builder. Make sure.
I deployed My Domain and started seeing component.

For more details on how to deploy my domain: https://help.salesforce.com/articleView?id=environment_hub_get_started_my_domain.htm&type=5

 

Thank you,

Mausam Padhiyar

Vishnu711735041Vishnu711735041
hi darshana 
do u got solution for ur doubt , i am facing same problem.
can u help me 
Firoz Khan 17Firoz Khan 17
Hey, If you did not found your component on the community site so try this tag

<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>51.0</apiVersion>
    <isExposed>true</isExposed>
    <targets>
        <target>lightningCommunity__Page</target>
    </targets>
</LightningComponentBundle>
Vipin Mishra 50Vipin Mishra 50
As suggested by Raj below code worked for me
,

You need to use the  js-meta.xml file as show below and push the changes 
changed from false to true.
Set isExposed --> True 

  <isExposed>true</isExposed>
Varsha JethwaniVarsha Jethwani
Actual Issue is My Domain. I saw below "Deploy My Domain" to see custom component in App Builder. Make sure.
I deployed My Domain "xyz" and later refreshed my page and again putting credentials then I started seeing component.
karthik chengalvarayankarthik chengalvarayan
@Varsha Jethwani ,
Your solution worked for me. Thank you very much
Valerie BossleyValerie Bossley
User-added image
I am so confused, I did everything as instructed and when i go to complete the step it says that the web component isnt on the home page.....But clearly it is. any suggestions?