1

I've retrieved my LWC source from the org, and then tried right clicking on the component folder in VS code (under force-app\main\default\lwc) and clicking SFDX: Delete from Project and Org, which then runs the command sfdx force:source:delete --sourcepath "path\to\project\force-app\main\default\lwc\myComponentName" --noprompt

In the output in the console, I can see it listing the components of the LWC, but then it reports a component failure, and the deployment fails.

=== Deleted Source
FULL NAME     TYPE                      PROJECT PATH
───────────────  ────────────────────────  ──────────────────────────────────────────────────────────────────
myComponentName  LightningComponentBundle  force-app\main\default\lwc\myComponentName
myComponentName  LightningComponentBundle  force-app\main\default\lwc\myComponentName\myComponentName.css
myComponentName  LightningComponentBundle  force-app\main\default\lwc\myComponentName\myComponentName.html
myComponentName  LightningComponentBundle  force-app\main\default\lwc\myComponentName\myComponentName.js
myComponentName  LightningComponentBundle  force-app\main\default\lwc\myComponentName\myComponentName.js-meta


=== Component Failures [1]
Type     Name                    Problem
───────  ──────────────────────  ────────────────────────────────────────────────────────
Warning  destructiveChanges.xml  No LightningComponentBundle named: myComponentName found

I'm not sure what exactly it's looking for here.

I've tried creating a destructiveChanges.xml file using the command sfdx force:source:manifest:create --sourcepath force-app\main\default\lwc\myComponentName -t destroy, and then trying the delete again, however the error still persists.

What am I doing wrong?

2
  • 1
    Are you sure the component is actually in your org and not just locally in your project?
    – Jeff Kranz
    Oct 11, 2022 at 16:11
  • Hmm I think that might be the issue. I had been trying to delete it multiple ways, and it looks like one of them must have worked as it's no longer there in the org browser.
    – Garywoo
    Oct 11, 2022 at 16:51

1 Answer 1

1

It appears that I had already deleted the LWC, and I just had a local copy of it in VS code.

I had been trying to delete it multiple ways, and it looks like one of them must have worked as it's no longer there in the org browser.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .