+ Start a Discussion
Serra 4Serra 4 

Delete a managed lightning web component from org

I added a lwc in a package. How to remove it now? I want to delete it.
SwethaSwetha (Salesforce Developers) 
HI Serra,

Please see the articles "Remove components from a Managed Package"(https://help.salesforce.com/articleView?id=000326278&language=en_US&type=1&mode=1 ) 

Hope this helps you. Please mark this answer as best so that others facing the
same issue will find this information useful.
Thank you
Serra 4Serra 4
Hi Swetha. I have opened a case on support 6 months ago to be able to remove components from package.  I can remove apex class, fields etc... but i cannot remove the lightning web component. I used Visual Studio to delete it, but i have this error:
Cannot delete managed object
ERROR running force:source:delete:  The delete operation failed in the org. Review the error messages below, delete any files locally if needed, and re-run the command if applicable.
10:39:20.637 sfdx force:source:delete --sourcepath c:\Users\serra\Desktop\InnerSource\loyaltyDev\force-app\main\default\lwc\manageLoyaltyCriteriaModal --noprompt ended with exit code 1
amelia pearlamelia pearl
  Select a component which you wish to delete, then click on delete button. This deletes the component provided that it is not referred in any lightning page. talktowendys (https://www.talktowendys.today/)
SwethaSwetha (Salesforce Developers) 
HI Serra,

Lightning Web Component cannot be deleted from a managed package, it can only be upgraded. So, if you have to deprecate the component, you will have to revert your package to beta state, deprecate the component and then release a new version.

Hope this helps you. Please mark this answer as best so that others facing thensame issue will find this information useful.
Thank you
Suraj Tripathi 47Suraj Tripathi 47
Hi Serra,

If Component is using in Package then we can not delete a Component Or Component App from the Org because it is used in Package and It can have Some Value which can affect any other place.
So We can't do this.
If It is not used anywhere then We can delete this in a Simple way.

If you find your Solution then mark this as the best answer.

Thank you!

Suraj Tripathi