1

I have created a project named "HelloWorldLightningWebComponent", and created a LWC component to it. While deploying the source to org from VSC, getting the error message. I have checked the version in both lwc's meta file and also sfdx-project.json file, its the same (45.0). Any ideas what is missing?

Also verified the source org for component with same name and didnt find any.

<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="helloWorld">
  <apiVersion>45.0</apiVersion>
  <isExposed>true</isExposed>
  <targets>
    <target>lightning__AppPage</target>
    <target>lightning__RecordPage</target>
    <target>lightning__HomePage</target>
  </targets>
</LightningComponentBundle>
{
  "packageDirectories": [
    {
      "path": "force-app",
      "default": true
    }
  ],
  "namespace": "",
  "sfdcLoginUrl": "https://login.salesforce.com",
  "sourceApiVersion": "45.0"
}
5
  • Please share the code, without that it's hard to tell what's wrong? Apr 13 at 19:09
  • ye, and project structure if possible
    – ytiq
    Apr 13 at 19:18
  • @MohithShrivastava Added the meta file and sfdx-project.json files.
    – Vignesh V
    Apr 13 at 19:27
  • @ytiq There is no change to project structure. Have created one as per trailhead module (trailhead.salesforce.com/content/learn/projects/…)
    – Vignesh V
    Apr 13 at 19:30
  • @vignesh Can you reach out to me on mohith.shrivastava@salesforce.com Apr 14 at 12:46
1

This error happens if you already have a Lightning Web Component in your instance with the same name that you are trying to create a new one.

Hence make sure to use a New org if you are doing a Trailhead or refresh all the components from your org using the Org Browser to make sure you are editing instead of adding a new one.

0

Not sure if that was the cause but I accidently created the new project under main folder of another project and when I was trying to deploy I got this error . Later I deleted the new project folder and made separate folder and I was able to deploy the component .

0

I had the same issue. Turns out it was a typo in my test folder name, I had an extra underscore in the folder name.

0

for my situation, it seems cause by a experimental feature "salesforcedx-vscode-core.experimental.deployRetrieve". go to file > preference and disable deployRetrieve

0

I had a similar error. In my case I had a folder named lwc in the navigation path to the actual location of the of the project. And I had another component at the same level as the correct one. Once I removed the entire folder of the extra component and updated the lwc folder, I was able to get past this error.

0

JSON suffix error. It happened to me and I changed the repository name from "lwc" to "LWC" and solved the problem.

0

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.