I have a SFDX Force-App that contains all of my classes, lightning web components, objects, triggers, etc. I've uploaded this force-app to my sandbox and my changes in my lwc was there and looked good so now I'm attempting to deploy this force-app to my production environment.
So I followed these steps:
1) I ran
sfdx force:source:convert -P /path/to/source/force-app/MyForceApp/main/default
This outputted a folder like metadataPackage_12345
2) So then I zipped it up with:
zip -r -X JAN-19-2019.zip metadataPackage_12345
3) I then ran a test run via:
sfdx force:mdapi:deploy --checkonly --zipfile JAN-19-2019.zip
This gave me a JobId: 0Af3k00000IwyHETFJ
4) I ran
sfdx force:mdapi:deploy:report
to check the status and it completed successfully.
5) After this finished, I then went to actually deploy it
sfdx force:mdapi:deploy --validateddeployrequestid 0Af3k00000IwyHETFJ
This also ran and completed successfully.
I then logged into my SF Prod instance and navigated to Set Up > Environments > Deploy > Deployment Status
and it shows both the validation and the deployment succeeded.
However, when I go to the location where I have my updated LWC, it doesn't appear to have my changes…
Is there any steps I'm missing to get the LWC to be updated?
Best Answer
Others new to LWC and LWC Trailhead: Lightning Web Components Basic may experience OP issue ...
In your VS Code project, in the LWC folder you will have
Create Lightning Web Components
of the Trailhead a LWC namedBikeCard
.Deploy Lightning Web Conponents
Handle Events in Lightning Web Components
, depending on how you unzip the fileBike Selector App for Trailhead
, you will now have an additional LWC calledselector
as well as the originalbikeCard
.bikeCard.js-meta.xml
is aLightningComponentBundle
, note that fileselector.js-meta.xml
is also aLightningComponentBundle
When you do an
SFDX: Deploy Source to Org
, your VS Code project is deployed to your Trailhead Playground.The instructions for step 4 ask you to create a new one-page one-region Lightning App. The LWC that you need to drag onto the canvas is called
selector
, notbikeCard
! It is easy to get confused and think you updated the bikeCard LWC as the whole trailhead is about bikes. So, you may think your deploy failed or there is some caching issue. But no, you just chose the wrong LWC. Names matter. Good names are best - having bikeCard and selector in the same project was a poor choice by the Trailhead team.