2

I'm trying to delete new Lightning Web Component without any luck.

I've tried to find it in Dev Console, but as you know it doesn't support Lightning Web Components yet. Another way I've tried to delete my lwc in VS Code and just deploy source to sandbox, but it still there in my sandbox org and I can see it in Lightning App Builder and when I try to retrieve source I see this error

ERROR:  Cannot read property 'fileName' of undefined.

But as mentioned here this should be fixed tomorrow https://github.com/forcedotcom/cli/issues/33

So for now I have it in org but don't have in VS Code.

Is there any sfdx command something like

sfdx force:lightning:lwc:delete -someflag lwcName

Thanks!

  • can you try this? sfdx force:source:delete -m LightningComponentBundle:componentName -r – Pranay Jaiswal Feb 20 at 11:12
  • @PranayJaiswal I have this error ERROR: The LightningComponentBundle named my lwc name was not found in the workspace. – chibis0v Feb 20 at 11:17
  • whats your version of SFDX cli? – Pranay Jaiswal Feb 20 at 11:18
  • @PranayJaiswal everything is up to date. @salesforce/plugin-generator 1.0.1 (core) @salesforce/sfdx-trust 2.0.1 (core) builtins 1.0.0 (core) salesforcedx 45.0.12 (pre-release) sfdx-cli: 6.53.0-67a9cbb60c – chibis0v Feb 20 at 11:21
4

Make sure that you have the most updated CLI version. On your terminal or command line use this:

sfdx force:source:delete -p <path-to-the-component-folder-on-your-machine>

It will ask you if you are sure, type y. And there you are.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.