1

I tried to do the trailhead module "Create a Hello World Lightning Web Component" and I followed all the steps but when I do deploy to source to org, it fails. The error which I get is: "DeployFailed: Deploy failed."

It might seem duplicate but I tried all possible answers I found. The API version of my target org is 45.0 and the sfdx extension has also version 45.0. Initially my sfdx cli version was 46.0 and it was throwing api version not found error. I have changed that to version 45.0 using - "sfdx force:config:set apiVersion=45.0 " command . Now I am getting the above mentioned error. No other information is available.

  • Can you run sfdx plugins:install salesforcedx@latest and try once again? – sanket kumar Apr 25 '19 at 5:49
  • Alternatively, you can also try removing sfdx CLI entirely and use a package manager like npm to manage your sfdx-cli installation. I've had to roll back the CLI version twice now to test random issues. – tsalb Apr 25 '19 at 7:33
  • What do you get if you type sfdx plugins --core for the main salesforcedx plugin version? – pchittum Apr 25 '19 at 22:16
  • @pchittum I get - salesforcedx 45.12.0 – user905 Apr 26 '19 at 0:29
  • @sanketkumar - tried that, doesn't work – user905 Apr 26 '19 at 0:30
3

Worth a shot: try deploying via the CLI rather than VS Code to get better error messaging. cd to your project directory and run the following command:

sfdx force:source:deploy --sourcepath \force-app

In my case this told me "Can't create lightning component bundle if there is already an aura definition bundle with the same name and namespace." I just had to delete the "helloWorld" aura component and then deploying the LWC worked. Hope this helps!

| improve this answer | |
  • 1
    I received a similarly vague Deploy Failed. DeployFailed [1,1] deploying a class and switched to CLI sfdx force:source:deploy -m ApexClass:classname and got a verbose error message referencing a variable that does not exist – bullcitydave Jun 25 '19 at 19:41
0

My issue turns out that I already had a lightning component with the same name, i've used this Salesforce Org many time for trailheads. Renamed the existing Aura component and the deployment worked. Was able to see the error using the terminal rather than the right clicking to deploy

| improve this answer | |

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.